diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-09 17:02:55 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-09 17:02:55 +0000 |
commit | aa0beecad0fa7cd8c62816b4dc7918f03b214b91 (patch) | |
tree | 12a76a8d07af49d083c5df35a5d253cb98295688 /app | |
parent | e46b56d7fcad573e9531acae9337811e586ed7b8 (diff) | |
download | redmine-aa0beecad0fa7cd8c62816b4dc7918f03b214b91.tar.gz redmine-aa0beecad0fa7cd8c62816b4dc7918f03b214b91.zip |
Move the file viewer to a partial.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1519 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/views/common/_file.rhtml | 11 | ||||
-rw-r--r-- | app/views/repositories/entry.rhtml | 12 |
2 files changed, 12 insertions, 11 deletions
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 @@ +<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> 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 @@ <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" %> |