Browse Source

Don't repeat revision on each line.

git-svn-id: http://svn.redmine.org/redmine/trunk@17398 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/4.0.0
Jean-Philippe Lang 6 years ago
parent
commit
f57cacb284
2 changed files with 7 additions and 8 deletions
  1. 4
    4
      app/views/wiki/annotate.html.erb
  2. 3
    4
      test/functional/wiki_controller_test.rb

+ 4
- 4
app/views/wiki/annotate.html.erb View File

@@ -20,17 +20,17 @@

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

+ 3
- 4
test/functional/wiki_controller_test.rb View File

@@ -702,11 +702,10 @@ class WikiControllerTest < Redmine::ControllerTest
assert_select 'td', :text => /h1\. CookBook documentation v2/
end

# Line 4
assert_select 'table.annotate tr:nth-child(4)' do
assert_select 'th.line-num', :text => '4'
# Line 2
assert_select 'table.annotate tr:nth-child(2)' do
assert_select 'th.line-num', :text => '2'
assert_select 'td.author', :text => /John Smith/
assert_select 'td', :text => /Line from v1/
end

# Line 5

Loading…
Cancel
Save