From: Jean-Philippe Lang Date: Mon, 9 Jun 2008 17:02:55 +0000 (+0000) Subject: Move the file viewer to a partial. X-Git-Tag: 0.8.0-RC1~462 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=aa0beecad0fa7cd8c62816b4dc7918f03b214b91;p=redmine.git Move the file viewer to a partial. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1519 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/common/_file.rhtml b/app/views/common/_file.rhtml new file mode 100644 index 000000000..43f5c6c4b --- /dev/null +++ b/app/views/common/_file.rhtml @@ -0,0 +1,11 @@ +
+ + +<% line_num = 1 %> +<% syntax_highlight(filename, to_utf8(content)).each_line do |line| %> + +<% line_num += 1 %> +<% end %> + +
<%= line_num %>
<%= line %>
+
diff --git a/app/views/repositories/entry.rhtml b/app/views/repositories/entry.rhtml index 309da76fc..8e1e1992c 100644 --- a/app/views/repositories/entry.rhtml +++ b/app/views/repositories/entry.rhtml @@ -1,16 +1,6 @@

<%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

-
- - -<% line_num = 1 %> -<% syntax_highlight(@path, to_utf8(@content)).each_line do |line| %> - -<% line_num += 1 %> -<% end %> - -
<%= line_num %>
<%= line %>
-
+<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> <% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %>