From 889d50089d4d98db83ba5617b526da50107be661 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 15 Aug 2007 20:20:18 +0000 Subject: Added syntax highlightment for repository files (using CodeRay). Supported languages: c, ruby, rhtml, yaml, html, xml. git-svn-id: http://redmine.rubyforge.org/svn/trunk@644 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/repositories/diff.rhtml | 12 ++++++------ app/views/repositories/entry.rhtml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'app/views/repositories') diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml index b1cfa8b44..86bde671f 100644 --- a/app/views/repositories/diff.rhtml +++ b/app/views/repositories/diff.rhtml @@ -14,7 +14,7 @@ <% cache(@cache_key) do %> <% @diff.each do |table_file| %> <% if @diff_type == 'sbs' %> - +
<% end %> @@ -47,7 +47,7 @@
@@ -33,13 +33,13 @@ <%= table_file[key].nb_line_left %> - <%= table_file[key].line_left %> +
<%= table_file[key].line_left %>
<%= table_file[key].nb_line_right %> - <%= table_file[key].line_right %> +
<%= table_file[key].line_right %>
<% else %> - +
<% if table_file[key].line_left.empty? %> <% else %> <% end %> diff --git a/app/views/repositories/entry.rhtml b/app/views/repositories/entry.rhtml index dfceac2ef..5ced710f5 100644 --- a/app/views/repositories/entry.rhtml +++ b/app/views/repositories/entry.rhtml @@ -1,6 +1,6 @@

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

-
@@ -71,11 +71,11 @@ - <%= table_file[key].line_right %> +
<%= table_file[key].line_right %>
- <%= table_file[key].line_left %> +
<%= table_file[key].line_left %>
+
@@ -8,10 +8,10 @@ <% line_num = 1 %> - <% @content.each_line do |line| %> + <% syntax_highlight(@path, @content).each_line do |line| %> - + <% line_num += 1 %> <% end %> -- cgit v1.2.3
<%= @path %>
<%= line_num %><%= h(line).gsub(/\s/, ' ') %>
<%= line %>