1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Don't repeat revision on each line.

git-svn-id: http://svn.redmine.org/redmine/trunk@17398 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2018-06-17 09:03:57 +00:00
parent e53660b717
commit f57cacb284
2 changed files with 7 additions and 8 deletions

View File

@ -20,17 +20,17 @@
<table class="filecontent annotate"> <table class="filecontent annotate">
<tbody> <tbody>
<% line_num = 1 %> <% line_num = 1; prev_version = nil %>
<% @annotate.lines.each do |line| -%> <% @annotate.lines.each do |line| -%>
<tr class="bloc-<%= colors[line[0]] %>"> <tr class="bloc-<%= colors[line[0]] %>">
<th class="line-num"><%= line_num %></th> <th class="line-num"><%= line_num %></th>
<td class="revision"><%= link_to line[0], :controller => 'wiki', <td class="revision"><%= link_to line[0], :controller => 'wiki',
:action => 'show', :project_id => @project, :action => 'show', :project_id => @project,
:id => @page.title, :version => line[0] %></td> :id => @page.title, :version => line[0] unless prev_version == line[0] %></td>
<td class="author"><%= line[1] %></td> <td class="author"><%= line[1] unless prev_version == line[0] %></td>
<td class="line-code"><pre><%= line[2] %></pre></td> <td class="line-code"><pre><%= line[2] %></pre></td>
</tr> </tr>
<% line_num += 1 %> <% line_num += 1; prev_version = line[0] %>
<% end -%> <% end -%>
</tbody> </tbody>
</table> </table>

View File

@ -702,11 +702,10 @@ class WikiControllerTest < Redmine::ControllerTest
assert_select 'td', :text => /h1\. CookBook documentation v2/ assert_select 'td', :text => /h1\. CookBook documentation v2/
end end
# Line 4 # Line 2
assert_select 'table.annotate tr:nth-child(4)' do assert_select 'table.annotate tr:nth-child(2)' do
assert_select 'th.line-num', :text => '4' assert_select 'th.line-num', :text => '2'
assert_select 'td.author', :text => /John Smith/ assert_select 'td.author', :text => /John Smith/
assert_select 'td', :text => /Line from v1/
end end
# Line 5 # Line 5