2011-10-21 14:40:36 -04:00
|
|
|
.file_stats= render "commits/diff_head"
|
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
- @commit.diffs.each do |diff|
|
|
|
|
- next if diff.diff.empty?
|
|
|
|
- file = (@commit.tree / diff.b_path)
|
|
|
|
- next unless file
|
|
|
|
.diff_file
|
|
|
|
.diff_file_header
|
|
|
|
- if diff.deleted_file
|
|
|
|
%strong{:id => "#{diff.b_path}"}= diff.a_path
|
2011-10-26 09:46:25 -04:00
|
|
|
- else
|
2011-10-21 14:14:55 -04:00
|
|
|
= link_to tree_file_project_path(@project, @commit.id, diff.b_path) do
|
|
|
|
%strong{:id => "#{diff.b_path}"}= diff.b_path
|
2011-10-08 17:36:38 -04:00
|
|
|
%br/
|
|
|
|
.diff_file_content
|
2011-10-20 15:00:00 -04:00
|
|
|
- if file.text?
|
2011-10-21 14:40:36 -04:00
|
|
|
= render :partial => "commits/text_file", :locals => { :diff => diff }
|
2011-10-20 15:00:00 -04:00
|
|
|
- elsif file.image?
|
2011-10-08 17:36:38 -04:00
|
|
|
.diff_file_content_image
|
2011-10-20 15:00:00 -04:00
|
|
|
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
2011-10-08 17:36:38 -04:00
|
|
|
- else
|
2011-10-26 09:46:25 -04:00
|
|
|
%p
|
2011-10-08 17:36:38 -04:00
|
|
|
%center No preview for this file type
|