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.