gitlabhq/app/views/commits/_diffs.html.haml

41 lines
1.3 KiB
Plaintext
Raw Normal View History

2012-04-06 00:00:15 +02:00
- if @suppress_diff
.alert-message.block-message
%p
%strong Warning! Large commit with more then 200 files changed.
%p To prevent performance issue we rejected diff information.
%p
But if you still want to see diff
= link_to "click this link", project_commit_path(@project, @commit.id, :force_show_diff => true), :class => "dark"
%p.cgray
Showing #{pluralize(diffs.count, "changed file")}
2011-11-21 08:16:10 +01:00
.file_stats
2012-02-06 21:32:04 +01:00
= render "commits/diff_head", :diffs => diffs
2012-04-06 00:00:15 +02:00
- unless @suppress_diff
- diffs.each_with_index do |diff, i|
- next if diff.diff.empty?
- file = (@commit.tree / diff.b_path)
- file = (@commit.prev_commit.tree / diff.a_path) unless file
- next unless file
.diff_file
.diff_file_header
- if diff.deleted_file
%strong{:id => "#{diff.a_path}"}= diff.a_path
- else
= link_to tree_file_project_ref_path(@project, @commit.id, diff.b_path) do
%strong{:id => "#{diff.b_path}"}= diff.b_path
%br/
.diff_file_content
- if file.text?
= render "commits/text_file", :diff => diff, :index => i
- elsif file.image?
.diff_file_content_image
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
- else
%p
%center No preview for this file type
2012-02-06 21:32:04 +01:00