2014-09-08 13:41:55 -04:00
|
|
|
- diff = diff_file.diff
|
2016-06-20 12:51:48 -04:00
|
|
|
- file_raw_path = namespace_project_raw_path(@project.namespace, @project, tree_join(diff_file.new_ref, diff.new_path))
|
2016-04-04 01:50:53 -04:00
|
|
|
// diff_refs will be nil for orphaned commits (e.g. first commit in repo)
|
2016-06-20 12:51:48 -04:00
|
|
|
- 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-04-04 01:50:53 -04:00
|
|
|
|
2012-12-01 07:49:21 -05:00
|
|
|
- if diff.renamed_file || diff.new_file || diff.deleted_file
|
|
|
|
.image
|
|
|
|
%span.wrap
|
2016-12-26 05:47:16 -05:00
|
|
|
.frame{ class: image_diff_class(diff) }
|
|
|
|
%img{ src: diff.deleted_file ? old_file_raw_path : file_raw_path, alt: diff.new_path }
|
2017-01-13 11:07:21 -05:00
|
|
|
%p.image-info= number_to_human_size(file.size)
|
2012-12-01 07:49:21 -05:00
|
|
|
- else
|
|
|
|
.image
|
2016-12-23 04:37:12 -05:00
|
|
|
.two-up.view
|
2012-12-01 07:49:21 -05:00
|
|
|
%span.wrap
|
|
|
|
.frame.deleted
|
2016-12-26 05:47:16 -05:00
|
|
|
%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-01-01 14:42:42 -05:00
|
|
|
%p.image-info.hide
|
2017-01-13 11:07:21 -05:00
|
|
|
%span.meta-filesize= number_to_human_size(old_file.size)
|
2012-12-01 07:49:21 -05:00
|
|
|
|
|
|
|
|
%b W:
|
2014-02-24 14:57:59 -05:00
|
|
|
%span.meta-width
|
2012-12-01 07:49:21 -05:00
|
|
|
|
|
|
|
|
%b H:
|
|
|
|
%span.meta-height
|
|
|
|
%span.wrap
|
|
|
|
.frame.added
|
2016-12-26 05:47:16 -05:00
|
|
|
%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-01-01 14:42:42 -05:00
|
|
|
%p.image-info.hide
|
2017-01-13 11:07:21 -05:00
|
|
|
%span.meta-filesize= number_to_human_size(file.size)
|
2012-12-01 07:49:21 -05:00
|
|
|
|
|
|
|
|
%b W:
|
2014-02-24 14:57:59 -05:00
|
|
|
%span.meta-width
|
2012-12-01 07:49:21 -05:00
|
|
|
|
|
|
|
|
%b H:
|
|
|
|
%span.meta-height
|
|
|
|
|
2016-12-23 04:37:12 -05:00
|
|
|
.swipe.view.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
.swipe-frame
|
|
|
|
.frame.deleted
|
2016-12-26 05:47:16 -05:00
|
|
|
%img{ src: old_file_raw_path, alt: diff.old_path }
|
2012-12-01 07:49:21 -05:00
|
|
|
.swipe-wrap
|
|
|
|
.frame.added
|
2016-12-26 05:47:16 -05:00
|
|
|
%img{ src: file_raw_path, alt: diff.new_path }
|
2012-12-01 07:49:21 -05:00
|
|
|
%span.swipe-bar
|
|
|
|
%span.top-handle
|
|
|
|
%span.bottom-handle
|
|
|
|
|
2016-12-23 04:37:12 -05:00
|
|
|
.onion-skin.view.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
.onion-skin-frame
|
|
|
|
.frame.deleted
|
2016-12-26 05:47:16 -05:00
|
|
|
%img{ src: old_file_raw_path, alt: diff.old_path }
|
2012-12-01 07:49:21 -05:00
|
|
|
.frame.added
|
2016-12-26 05:47:16 -05:00
|
|
|
%img{ src: file_raw_path, alt: diff.new_path }
|
2014-02-24 14:57:59 -05:00
|
|
|
.controls
|
2012-12-01 07:49:21 -05:00
|
|
|
.transparent
|
|
|
|
.drag-track
|
2016-12-26 05:47:16 -05:00
|
|
|
.dragger{ :style => "left: 0px;" }
|
2012-12-01 07:49:21 -05:00
|
|
|
.opaque
|
|
|
|
|
|
|
|
|
2014-01-01 14:42:42 -05:00
|
|
|
.view-modes.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
%ul.view-modes-menu
|
2016-12-26 05:47:16 -05:00
|
|
|
%li.two-up{ data: { mode: 'two-up' } } 2-up
|
|
|
|
%li.swipe{ data: { mode: 'swipe' } } Swipe
|
|
|
|
%li.onion-skin{ data: { mode: 'onion-skin' } } Onion skin
|