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

71 lines
2.2 KiB
Text
Raw Normal View History

2015-04-26 12:48:37 +05:30
- diff = diff_file.diff
2016-04-02 18:10:28 +05:30
- file_raw_path = namespace_project_raw_path(@project.namespace, @project, tree_join(@commit.id, 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)
- if diff_refs
- old_commit_id = diff_refs.first.id
- old_file_raw_path = namespace_project_raw_path(@project.namespace, @project, tree_join(old_commit_id, diff.old_path))
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-06-02 11:05:42 +05:30
%a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(old_commit_id, 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
2015-04-26 12:48:37 +05:30
%a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.id, 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