summaryrefslogtreecommitdiffstats
path: root/app/views/repositories/annotate.html.erb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-08-23 08:40:39 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-08-23 08:40:39 +0000
commit9dd2197cf5cb26ad08c7d6ba89c277a4c333c41c (patch)
tree1e54ed75b055f88d64d1d437ac3846ba1c23de78 /app/views/repositories/annotate.html.erb
parentddd45e56a27f7a7b52ba41ba4397e399751a3071 (diff)
downloadredmine-9dd2197cf5cb26ad08c7d6ba89c277a4c333c41c.tar.gz
redmine-9dd2197cf5cb26ad08c7d6ba89c277a4c333c41c.zip
rename .rhtml to .html.erb of app/views/repositories/annotate.rhtml.
:rhtml and :rxml were finally removed as template handlers at Rails 3.1 RC4. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6539 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/repositories/annotate.html.erb')
-rw-r--r--app/views/repositories/annotate.html.erb36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/views/repositories/annotate.html.erb b/app/views/repositories/annotate.html.erb
new file mode 100644
index 000000000..498507148
--- /dev/null
+++ b/app/views/repositories/annotate.html.erb
@@ -0,0 +1,36 @@
+<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
+
+<div class="contextual">
+ <%= render :partial => 'navigation' %>
+</div>
+
+<h2><%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
+
+<p><%= render :partial => 'link_to_functions' %></p>
+
+<% 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, to_utf8(@annotate.content)).each_line 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>
+ </tr>
+ <% line_num += 1 %>
+ <% end %>
+ </tbody>
+</table>
+</div>
+
+<% html_title(l(:button_annotate)) -%>
+
+<% content_for :header_tags do %>
+<%= stylesheet_link_tag 'scm' %>
+<% end %>