debian-mirror-gitlab/app/views/projects/diffs/_image.html.haml

70 lines
2.2 KiB
Text
Raw Normal View History

2015-04-26 12:48:37 +05:30
- diff = diff_file.diff
2016-08-24 12:49:21 +05:30
- file_raw_path = namespace_project_raw_path(@project.namespace, @project, tree_join(diff_file.new_ref, diff.new_path))
2016-06-02 11:05:42 +05:30
// diff_refs will be nil for orphaned commits (e.g. first commit in repo)
2016-08-24 12:49:21 +05:30
- if diff_file.old_ref
- old_file_raw_path = namespace_project_raw_path(@project.namespace, @project, tree_join(diff_file.old_ref, diff.old_path))
2016-06-02 11:05:42 +05:30
2014-09-02 18:07:02 +05:30
- if diff.renamed_file || diff.new_file || diff.deleted_file
.image
%span.wrap
.frame{class: image_diff_class(diff)}
2016-04-02 18:10:28 +05:30
%img{src: diff.deleted_file ? old_file_raw_path : file_raw_path}
2014-09-02 18:07:02 +05:30
%p.image-info= "#{number_to_human_size file.size}"
- else
.image
%div.two-up.view
%span.wrap
.frame.deleted
2016-08-24 12:49:21 +05:30
%a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.old_ref, diff.old_path))}
2016-04-02 18:10:28 +05:30
%img{src: old_file_raw_path}
2014-09-02 18:07:02 +05:30
%p.image-info.hide
%span.meta-filesize= "#{number_to_human_size old_file.size}"
|
%b W:
%span.meta-width
|
%b H:
%span.meta-height
%span.wrap
.frame.added
2016-08-24 12:49:21 +05:30
%a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.new_ref, diff.new_path))}
2016-04-02 18:10:28 +05:30
%img{src: file_raw_path}
2014-09-02 18:07:02 +05:30
%p.image-info.hide
%span.meta-filesize= "#{number_to_human_size file.size}"
|
%b W:
%span.meta-width
|
%b H:
%span.meta-height
%div.swipe.view.hide
.swipe-frame
.frame.deleted
2016-04-02 18:10:28 +05:30
%img{src: old_file_raw_path}
2014-09-02 18:07:02 +05:30
.swipe-wrap
.frame.added
2016-04-02 18:10:28 +05:30
%img{src: file_raw_path}
2014-09-02 18:07:02 +05:30
%span.swipe-bar
%span.top-handle
%span.bottom-handle
%div.onion-skin.view.hide
.onion-skin-frame
.frame.deleted
2016-04-02 18:10:28 +05:30
%img{src: old_file_raw_path}
2014-09-02 18:07:02 +05:30
.frame.added
2016-04-02 18:10:28 +05:30
%img{src: file_raw_path}
2014-09-02 18:07:02 +05:30
.controls
.transparent
.drag-track
.dragger{:style => "left: 0px;"}
.opaque
.view-modes.hide
%ul.view-modes-menu
%li.two-up{data: {mode: 'two-up'}} 2-up
%li.swipe{data: {mode: 'swipe'}} Swipe
%li.onion-skin{data: {mode: 'onion-skin'}} Onion skin