diff options
-rw-r--r-- | app/views/wiki/annotate.html.erb | 8 | ||||
-rw-r--r-- | test/functional/wiki_controller_test.rb | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/app/views/wiki/annotate.html.erb b/app/views/wiki/annotate.html.erb index 950a5a77c..1b48f5db8 100644 --- a/app/views/wiki/annotate.html.erb +++ b/app/views/wiki/annotate.html.erb @@ -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> diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 193efb0b7..c0a169d7b 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -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 |