diff app/views/repositories/annotate.html.erb @ 1464:261b3d9a4903 redmine-2.4

Update to Redmine 2.4 branch rev 12663
author Chris Cannam
date Tue, 14 Jan 2014 14:37:42 +0000
parents 433d4f72a19b
children
line wrap: on
line diff
--- a/app/views/repositories/annotate.html.erb	Fri Jun 14 09:05:06 2013 +0100
+++ b/app/views/repositories/annotate.html.erb	Tue Jan 14 14:37:42 2014 +0000
@@ -16,11 +16,21 @@
     <% 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>
+      <tr id="L<%= line_num %>" class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>">
+        <th class="line-num"><a href="#L<%= line_num %>"><%= line_num %></a></th>
         <td class="revision">
-        <%= (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>
+          <% if revision && revision != previous_revision %>
+            <%= revision.identifier ?
+                  link_to_revision(revision, @repository) : format_revision(revision) %>
+          <% end %>
+        </td>
+        <td class="author">
+          <% if revision && revision != previous_revision %>
+            <% author = Redmine::CodesetUtil.to_utf8(revision.author.to_s,
+                                                     @repository.repo_log_encoding) %>
+            <%= author.split('<').first %>
+          <% end %>
+        </td>
         <td class="line-code"><pre><%= line.html_safe %></pre></td>
       </tr>
       <% line_num += 1; previous_revision = revision %>