To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / repositories / annotate.html.erb @ 1591:63650ae64bf2

History | View | Annotate | Download (1.74 KB)

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