Move the file viewer to a partial.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1519 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-06-09 17:02:55 +00:00
parent e46b56d7fc
commit aa0beecad0
2 changed files with 12 additions and 11 deletions

View File

@ -0,0 +1,11 @@
<div class="autoscroll">
<table class="filecontent CodeRay">
<tbody>
<% line_num = 1 %>
<% syntax_highlight(filename, to_utf8(content)).each_line do |line| %>
<tr><th class="line-num" id="L<%= line_num %>"><%= line_num %></th><td class="line-code"><pre><%= line %></pre></td></tr>
<% line_num += 1 %>
<% end %>
</tbody>
</table>
</div>

View File

@ -1,16 +1,6 @@
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
<div class="autoscroll">
<table class="filecontent CodeRay">
<tbody>
<% line_num = 1 %>
<% syntax_highlight(@path, to_utf8(@content)).each_line do |line| %>
<tr><th class="line-num" id="L<%= line_num %>"><%= line_num %></th><td class="line-code"><pre><%= line %></pre></td></tr>
<% line_num += 1 %>
<% end %>
</tbody>
</table>
</div>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>