You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

annotate.html.erb 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
  2. <div class="contextual">
  3. <%= render :partial => 'navigation' %>
  4. </div>
  5. <h2 class="breadcrumbs"><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
  6. <%= render :partial => 'link_to_functions' %>
  7. <% if @annotate %>
  8. <% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %>
  9. <div class="autoscroll">
  10. <table class="filecontent annotate syntaxhl">
  11. <tbody>
  12. <% line_num = 1; previous_revision = nil %>
  13. <% syntax_highlight_lines(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each do |line| %>
  14. <% revision = @annotate.revisions[line_num - 1] %>
  15. <tr id="L<%= line_num %>" class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %> <%= previous_revision && revision && revision != previous_revision ? 'bloc-change' : nil%>">
  16. <th class="line-num"><a href="#L<%= line_num %>"><%= line_num %></a></th>
  17. <td class="revision">
  18. <% if revision && revision != previous_revision %>
  19. <%= revision.identifier ?
  20. link_to_revision(revision, @repository) : format_revision(revision) %>
  21. <% end %>
  22. </td>
  23. <td class="author">
  24. <% if revision && revision != previous_revision %>
  25. <% author = Redmine::CodesetUtil.to_utf8(revision.author.to_s,
  26. @repository.repo_log_encoding) %>
  27. <%= author.split('<').first %>
  28. <% end %>
  29. </td>
  30. <td class="line-code"><pre><%= line.html_safe %></pre></td>
  31. </tr>
  32. <% line_num += 1; previous_revision = revision %>
  33. <% end %>
  34. </tbody>
  35. </table>
  36. </div>
  37. <% else %>
  38. <p id="errorExplanation"><%= @error_message %></p>
  39. <% end %>
  40. <% html_title(l(:button_annotate)) -%>
  41. <% content_for :header_tags do %>
  42. <%= stylesheet_link_tag 'scm' %>
  43. <% end %>