Add basic information on the redmine code review page

Source: Internet
Author: User

Redmine code review plug-in can displayCodeBut the code author, release time, and so on are missing, so you need to modify the plug-in and add this function. Display page when no modification is made:

We can see that only the code is shown in the figure.

What we need to do is to add and display the basic information above. We have studied code_review.Source codeThen, it is found that the relevant content is in/APP/views/code_review/_update_diff_view.html. ERB, add the following code segment:

 
  
  
id Changeset. ID action revision commiter committed_on comment
<% = H @ change. id %> <% = H @ change. changesetid %> <% = H @ change. action %> <% = H @ Changeset. revision %> <% = H @ Changeset. committer %> <% = H @ Changeset. committed_on %> <% = H @ Changeset. comments %>

This code shows the basic information and is called using the following JavaScript code:

 
VaR tables =$ $ ('# Content table. filecontent'); If (tables. length> 0) {var table = tables [0]; new insertion. before (table, $ ('code-review-assign-info '));}

Code-review-assign-info is a css framework, which must be defined in/assert/stylesheets/code_review.css:

 
# Code-review-assign-Info {text-align: center; Background-color: #0f2059; color: White; padding-left: 2px; padding-Right: 2px; cursor: default ;}

After the preceding modifications, we can see the changes shown in:

By comparing the two images, we can see that the extra information is rewritten by the newly added code. This is basically a good implementation, but when multiple files are displayed at the same time, it will encounter problems, which need to be solved next.

Through the study of this part of content, I have learned some basic knowledge about HTML, CSS, and JavaScript, but it is still superficial and requires further learning.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.