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

27 lines
862 B
Text
Raw Normal View History

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-02-06 21:32:04 +01:00
- diffs.each_with_index do |diff, i|
2011-10-08 23:36:38 +02:00
- next if diff.diff.empty?
- file = (@commit.tree / diff.b_path)
- file = (@commit.prev_commit.tree / diff.a_path) unless file
2011-10-08 23:36:38 +02:00
- next unless file
.diff_file
.diff_file_header
- if diff.deleted_file
%strong{:id => "#{diff.a_path}"}= diff.a_path
- else
2011-11-16 06:38:53 +01:00
= link_to tree_file_project_ref_path(@project, @commit.id, diff.b_path) do
2011-10-21 20:14:55 +02:00
%strong{:id => "#{diff.b_path}"}= diff.b_path
2011-10-08 23:36:38 +02:00
%br/
.diff_file_content
2011-10-20 21:00:00 +02:00
- if file.text?
= render "commits/text_file", :diff => diff, :index => i
2011-10-20 21:00:00 +02:00
- elsif file.image?
2011-10-08 23:36:38 +02:00
.diff_file_content_image
2011-10-20 21:00:00 +02:00
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
2011-10-08 23:36:38 +02:00
- else
%p
2011-10-08 23:36:38 +02:00
%center No preview for this file type
2012-02-06 21:32:04 +01:00