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

70 lines
2.3 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
2017-08-17 22:00:37 +05:30
.frame{ class: image_diff_class(diff) }
%img{ src: diff.deleted_file ? old_file_raw_path : file_raw_path, alt: diff.new_path }
%p.image-info= number_to_human_size(file.size)
2014-09-02 18:07:02 +05:30
- else
.image
2017-08-17 22:00:37 +05:30
.two-up.view
2014-09-02 18:07:02 +05:30
%span.wrap
.frame.deleted
2017-08-17 22:00:37 +05:30
%a{ href: namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.old_ref, diff.old_path)) }
%img{ src: old_file_raw_path, alt: diff.old_path }
2014-09-02 18:07:02 +05:30
%p.image-info.hide
2017-08-17 22:00:37 +05:30
%span.meta-filesize= number_to_human_size(old_file.size)
2014-09-02 18:07:02 +05:30
|
%b W:
%span.meta-width
|
%b H:
%span.meta-height
%span.wrap
.frame.added
2017-08-17 22:00:37 +05:30
%a{ href: namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.new_ref, diff.new_path)) }
%img{ src: file_raw_path, alt: diff.new_path }
2014-09-02 18:07:02 +05:30
%p.image-info.hide
2017-08-17 22:00:37 +05:30
%span.meta-filesize= number_to_human_size(file.size)
2014-09-02 18:07:02 +05:30
|
%b W:
%span.meta-width
|
%b H:
%span.meta-height
2017-08-17 22:00:37 +05:30
.swipe.view.hide
2014-09-02 18:07:02 +05:30
.swipe-frame
.frame.deleted
2017-08-17 22:00:37 +05:30
%img{ src: old_file_raw_path, alt: diff.old_path }
2014-09-02 18:07:02 +05:30
.swipe-wrap
.frame.added
2017-08-17 22:00:37 +05:30
%img{ src: file_raw_path, alt: diff.new_path }
2014-09-02 18:07:02 +05:30
%span.swipe-bar
%span.top-handle
%span.bottom-handle
2017-08-17 22:00:37 +05:30
.onion-skin.view.hide
2014-09-02 18:07:02 +05:30
.onion-skin-frame
.frame.deleted
2017-08-17 22:00:37 +05:30
%img{ src: old_file_raw_path, alt: diff.old_path }
2014-09-02 18:07:02 +05:30
.frame.added
2017-08-17 22:00:37 +05:30
%img{ src: file_raw_path, alt: diff.new_path }
2014-09-02 18:07:02 +05:30
.controls
.transparent
.drag-track
2017-08-17 22:00:37 +05:30
.dragger{ :style => "left: 0px;" }
2014-09-02 18:07:02 +05:30
.opaque
.view-modes.hide
%ul.view-modes-menu
2017-08-17 22:00:37 +05:30
%li.two-up{ data: { mode: 'two-up' } } 2-up
%li.swipe{ data: { mode: 'swipe' } } Swipe
%li.onion-skin{ data: { mode: 'onion-skin' } } Onion skin