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
|
|
|
|
.frame{class: image_diff_class(diff)}
|
2016-02-17 05:08:47 -05:00
|
|
|
%img{src: diff.deleted_file ? old_file_raw_path : file_raw_path}
|
2012-12-01 07:49:21 -05:00
|
|
|
%p.image-info= "#{number_to_human_size file.size}"
|
|
|
|
- else
|
|
|
|
.image
|
|
|
|
%div.two-up.view
|
|
|
|
%span.wrap
|
|
|
|
.frame.deleted
|
2016-06-20 12:51:48 -04:00
|
|
|
%a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.old_ref, diff.old_path))}
|
2016-02-16 11:29:45 -05:00
|
|
|
%img{src: old_file_raw_path}
|
2014-01-01 14:42:42 -05:00
|
|
|
%p.image-info.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
%span.meta-filesize= "#{number_to_human_size old_file.size}"
|
|
|
|
|
|
|
|
|
%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-06-20 12:51:48 -04:00
|
|
|
%a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(diff_file.new_ref, diff.new_path))}
|
2016-02-16 11:29:45 -05:00
|
|
|
%img{src: file_raw_path}
|
2014-01-01 14:42:42 -05:00
|
|
|
%p.image-info.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
%span.meta-filesize= "#{number_to_human_size file.size}"
|
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
2014-01-01 14:42:42 -05:00
|
|
|
%div.swipe.view.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
.swipe-frame
|
|
|
|
.frame.deleted
|
2016-02-16 11:29:45 -05:00
|
|
|
%img{src: old_file_raw_path}
|
2012-12-01 07:49:21 -05:00
|
|
|
.swipe-wrap
|
|
|
|
.frame.added
|
2016-02-16 11:29:45 -05:00
|
|
|
%img{src: file_raw_path}
|
2012-12-01 07:49:21 -05:00
|
|
|
%span.swipe-bar
|
|
|
|
%span.top-handle
|
|
|
|
%span.bottom-handle
|
|
|
|
|
2014-01-01 14:42:42 -05:00
|
|
|
%div.onion-skin.view.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
.onion-skin-frame
|
|
|
|
.frame.deleted
|
2016-02-16 11:29:45 -05:00
|
|
|
%img{src: old_file_raw_path}
|
2012-12-01 07:49:21 -05:00
|
|
|
.frame.added
|
2016-02-16 11:29:45 -05:00
|
|
|
%img{src: file_raw_path}
|
2014-02-24 14:57:59 -05:00
|
|
|
.controls
|
2012-12-01 07:49:21 -05:00
|
|
|
.transparent
|
|
|
|
.drag-track
|
|
|
|
.dragger{:style => "left: 0px;"}
|
|
|
|
.opaque
|
|
|
|
|
|
|
|
|
2014-01-01 14:42:42 -05:00
|
|
|
.view-modes.hide
|
2012-12-01 07:49:21 -05:00
|
|
|
%ul.view-modes-menu
|
|
|
|
%li.two-up{data: {mode: 'two-up'}} 2-up
|
|
|
|
%li.swipe{data: {mode: 'swipe'}} Swipe
|
2013-12-30 17:38:53 -05:00
|
|
|
%li.onion-skin{data: {mode: 'onion-skin'}} Onion skin
|