diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml index eaef1abf5..73c1e8c9e 100644 --- a/app/views/repositories/diff.rhtml +++ b/app/views/repositories/diff.rhtml @@ -11,82 +11,78 @@ <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %>

<% end %> -<% cache(@cache_key) do %> -<% @diff.each do |table_file| %> +<% cache(@cache_key) do -%> +<% @diff.each do |table_file| -%>
-<% if @diff_type == 'sbs' %> - - - - - - - - - - - - <% table_file.keys.sort.each do |key| %> - - - - - - - <% end %> - -
- <%= table_file.file_name %> -
@<%= format_revision @rev %>@<%= format_revision @rev_to %>
- <%= table_file[key].nb_line_left %> - -
<%=to_utf8 table_file[key].line_left %>
-
- <%= table_file[key].nb_line_right %> - -
<%=to_utf8 table_file[key].line_right %>
-
+<% if @diff_type == 'sbs' -%> + + + + + + + + + +<% prev_line_left, prev_line_right = nil, nil -%> +<% table_file.keys.sort.each do |key| -%> +<% if prev_line_left && prev_line_right && (table_file[key].nb_line_left != prev_line_left+1) && (table_file[key].nb_line_right != prev_line_right+1) -%> + +<% end -%> + + + + + + +<% prev_line_left, prev_line_right = table_file[key].nb_line_left.to_i, table_file[key].nb_line_right.to_i -%> +<% end -%> + +
<%= table_file.file_name %>
@<%= format_revision @rev %>@<%= format_revision @rev_to %>
<%= table_file[key].nb_line_left %> +
<%=to_utf8 table_file[key].line_left %>
+
<%= table_file[key].nb_line_right %> +
<%=to_utf8 table_file[key].line_right %>
+
+ +<% else -%> + + + + + + + + + + +<% prev_line_left, prev_line_right = nil, nil -%> +<% table_file.keys.sort.each do |key, line| %> +<% if prev_line_left && prev_line_right && (table_file[key].nb_line_left != prev_line_left+1) && (table_file[key].nb_line_right != prev_line_right+1) -%> + +<% end -%> + + + + <% if table_file[key].line_left.empty? -%> + + <% else -%> + + <% end -%> + +<% prev_line_left = table_file[key].nb_line_left.to_i if table_file[key].nb_line_left.to_i > 0 -%> +<% prev_line_right = table_file[key].nb_line_right.to_i if table_file[key].nb_line_right.to_i > 0 -%> +<% end -%> + +
<%= table_file.file_name %>
@<%= format_revision @rev %>@<%= format_revision @rev_to %>
<%= table_file[key].nb_line_left %><%= table_file[key].nb_line_right %> +
<%=to_utf8 table_file[key].line_right %>
+
+
<%=to_utf8 table_file[key].line_left %>
+
+<% end -%> -<% else %> - - - - - - - - - - - - - <% table_file.keys.sort.each do |key, line| %> - - - - <% if table_file[key].line_left.empty? %> - - <% else %> - - <% end %> - - <% end %> - -
- <%= table_file.file_name %> -
@<%= format_revision @rev %>@<%= format_revision @rev_to %>
- <%= table_file[key].nb_line_left %> - - <%= table_file[key].nb_line_right %> - -
<%=to_utf8 table_file[key].line_right %>
-
-
<%=to_utf8 table_file[key].line_left %>
-
-<% end %>
-<% end %> -<% end %> +<% end -%> +<% end -%> <% html_title(with_leading_slash(@path), 'Diff') -%> diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css index 66847af8c..d1495a5ef 100644 --- a/public/stylesheets/scm.css +++ b/public/stylesheets/scm.css @@ -2,7 +2,7 @@ table.filecontent { border: 1px solid #ccc; border-collapse: collapse; width:98%; } table.filecontent th { border: 1px solid #ccc; background-color: #eee; } table.filecontent th.filename { background-color: #ddc; text-align: left; } -table.filecontent tr.spacing { border: 1px solid #d7d7d7; } +table.filecontent tr.spacing td { border: 1px solid #d7d7d7; height: 0.4em; } table.filecontent th.line-num { border: 1px solid #d7d7d7; font-size: 0.8em;