diff app/views/repositories/annotate.html.erb @ 1115:433d4f72a19b redmine-2.2

Update to Redmine SVN revision 11137 on 2.2-stable branch
author Chris Cannam
date Mon, 07 Jan 2013 12:01:42 +0000
parents cbb26bc654de
children 261b3d9a4903
line wrap: on
line diff
--- a/app/views/repositories/annotate.html.erb	Wed Jun 27 14:54:18 2012 +0100
+++ b/app/views/repositories/annotate.html.erb	Mon Jan 07 12:01:42 2013 +0000
@@ -6,24 +6,24 @@
 
 <h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
 
-<p><%= render :partial => 'link_to_functions' %></p>
+<%= render :partial => 'link_to_functions' %>
 
 <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
 
 <div class="autoscroll">
 <table class="filecontent annotate syntaxhl">
   <tbody>
-    <% line_num = 1 %>
-    <% syntax_highlight(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each_line do |line| %>
+    <% line_num = 1; previous_revision = nil %>
+    <% syntax_highlight_lines(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each do |line| %>
       <% revision = @annotate.revisions[line_num - 1] %>
       <tr class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>">
         <th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th>
         <td class="revision">
-        <%= (revision.identifier ? link_to_revision(revision, @project) : format_revision(revision)) if revision %></td>
-        <td class="author"><%= h(revision.author.to_s.split('<').first) if revision %></td>
-        <td class="line-code"><pre><%= line %></pre></td>
+        <%= (revision.identifier ? link_to_revision(revision, @repository) : format_revision(revision)) if revision && revision != previous_revision %></td>
+        <td class="author"><%= h(revision.author.to_s.split('<').first) if revision && revision != previous_revision %></td>
+        <td class="line-code"><pre><%= line.html_safe %></pre></td>
       </tr>
-      <% line_num += 1 %>
+      <% line_num += 1; previous_revision = revision %>
     <% end %>
   </tbody>
 </table>