2015-09-30 06:31:02 -04:00
|
|
|
.diff-file{id: "diff-#{i}", data: diff_file_html_data(project, diff_commit, diff_file)}
|
2015-10-20 08:23:56 -04:00
|
|
|
.diff-header{id: "file-path-#{hexdigest(diff_file.file_path)}"}
|
2015-09-30 06:31:02 -04:00
|
|
|
- if diff_file.diff.submodule?
|
2015-05-29 05:01:40 -04:00
|
|
|
%span
|
2015-12-02 08:55:36 -05:00
|
|
|
= icon('archive fw')
|
|
|
|
%strong
|
2015-12-04 14:31:01 -05:00
|
|
|
= submodule_link(blob, @commit.id, project.repository)
|
2014-09-08 09:26:49 -04:00
|
|
|
- else
|
2015-03-23 12:38:52 -04:00
|
|
|
%span
|
2015-12-02 08:55:36 -05:00
|
|
|
= blob_icon blob.mode, blob.name
|
|
|
|
= link_to "#diff-#{i}" do
|
|
|
|
%strong
|
|
|
|
= diff_file.new_path
|
|
|
|
|
2015-09-30 06:31:02 -04:00
|
|
|
- if diff_file.deleted_file
|
2015-12-02 08:55:36 -05:00
|
|
|
deleted
|
2015-09-30 06:31:02 -04:00
|
|
|
- elsif diff_file.renamed_file
|
2015-12-02 08:55:36 -05:00
|
|
|
renamed from
|
|
|
|
%strong
|
|
|
|
= diff_file.old_path
|
2015-09-30 06:31:02 -04:00
|
|
|
|
2015-03-23 12:38:52 -04:00
|
|
|
- if diff_file.mode_changed?
|
2015-12-02 08:55:36 -05:00
|
|
|
%small
|
|
|
|
= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}"
|
2014-09-08 09:26:49 -04:00
|
|
|
|
2015-10-08 16:22:34 -04:00
|
|
|
.diff-controls
|
2015-12-18 10:14:12 -05:00
|
|
|
- if blob_text_viewable?(blob)
|
2015-03-18 23:12:19 -04:00
|
|
|
= link_to '#', class: 'js-toggle-diff-comments btn btn-sm active has_tooltip', title: "Toggle comments for this file" do
|
2015-03-18 20:53:43 -04:00
|
|
|
%i.fa.fa-comments
|
2014-09-29 08:48:05 -04:00
|
|
|
|
2014-09-08 09:26:49 -04:00
|
|
|
|
2015-09-30 06:31:02 -04:00
|
|
|
- if editable_diff?(diff_file)
|
2014-09-28 05:02:29 -04:00
|
|
|
= edit_blob_link(@merge_request.source_project,
|
|
|
|
@merge_request.source_branch, diff_file.new_path,
|
2015-12-18 04:03:34 -05:00
|
|
|
from_merge_request_id: @merge_request.id)
|
|
|
|
|
2014-09-08 09:26:49 -04:00
|
|
|
|
2015-09-30 06:31:02 -04:00
|
|
|
= view_file_btn(diff_commit.id, diff_file, project)
|
2014-09-08 09:26:49 -04:00
|
|
|
|
2015-03-17 10:39:21 -04:00
|
|
|
.diff-content.diff-wrap-lines
|
2014-09-08 09:26:49 -04:00
|
|
|
-# Skipp all non non-supported blobs
|
|
|
|
- return unless blob.respond_to?('text?')
|
2015-12-18 10:14:12 -05:00
|
|
|
- if blob_text_viewable?(blob)
|
2015-11-17 10:08:58 -05:00
|
|
|
- if diff_view == 'parallel'
|
2014-09-08 09:26:49 -04:00
|
|
|
= render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob, index: i
|
|
|
|
- else
|
|
|
|
= render "projects/diffs/text_file", diff_file: diff_file, index: i
|
|
|
|
- elsif blob.image?
|
2015-10-20 08:23:56 -04:00
|
|
|
- old_file = project.repository.prev_blob_for_diff(diff_commit, diff_file)
|
2014-09-08 13:41:55 -04:00
|
|
|
= render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i
|
2014-09-08 09:26:49 -04:00
|
|
|
- else
|
|
|
|
.nothing-here-block No preview for this file type
|