Compare images
This commit is contained in:
parent
31bc2b9495
commit
9497b1a76e
2 changed files with 17 additions and 8 deletions
|
@ -101,16 +101,19 @@
|
||||||
margin:50px;
|
margin:50px;
|
||||||
padding:1px;
|
padding:1px;
|
||||||
max-width:400px;
|
max-width:400px;
|
||||||
}
|
|
||||||
&.diff_image_removed {
|
&.diff_image_removed {
|
||||||
img {
|
|
||||||
border: 1px solid #C00;
|
border: 1px solid #C00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.diff_image_added {
|
||||||
|
border: 1px solid #0C0;;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.diff_image_added {
|
&.img_compared {
|
||||||
img {
|
img {
|
||||||
border: 1px solid #0C0;;
|
max-width:300px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,13 @@
|
||||||
- if file.text?
|
- if file.text?
|
||||||
= render "commits/text_file", :diff => diff, :index => i
|
= render "commits/text_file", :diff => diff, :index => i
|
||||||
- elsif file.image?
|
- elsif file.image?
|
||||||
.diff_file_content_image{:class => image_diff_class(diff)}
|
- if diff.renamed_file || diff.new_file || diff.deleted_file
|
||||||
%img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
.diff_file_content_image
|
||||||
|
%img{:class => image_diff_class(diff), :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
||||||
|
- else
|
||||||
|
- old_file = (@commit.prev_commit.tree / diff.old_path)
|
||||||
|
.diff_file_content_image.img_compared
|
||||||
|
%img{:class => "diff_image_removed", :src => "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
|
||||||
|
%img{:class => "diff_image_added", :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
|
||||||
- else
|
- else
|
||||||
%p.nothing_here_message No preview for this file type
|
%p.nothing_here_message No preview for this file type
|
||||||
|
|
Loading…
Add table
Reference in a new issue