2016-01-29 22:53:50 +05:30
|
|
|
.diff-file.file-holder{id: "diff-#{i}", data: diff_file_html_data(project, diff_commit, diff_file)}
|
|
|
|
.file-title{id: "file-path-#{hexdigest(diff_file.file_path)}"}
|
2015-10-24 18:46:33 +05:30
|
|
|
- if diff_file.diff.submodule?
|
2015-09-11 14:41:01 +05:30
|
|
|
%span
|
2015-12-23 02:04:40 +05:30
|
|
|
= icon('archive fw')
|
|
|
|
%strong
|
|
|
|
= submodule_link(blob, @commit.id, project.repository)
|
2015-04-26 12:48:37 +05:30
|
|
|
- else
|
2016-01-29 22:53:50 +05:30
|
|
|
= blob_icon blob.mode, blob.name
|
2015-12-23 02:04:40 +05:30
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
= link_to "#diff-#{i}" do
|
|
|
|
- if diff_file.renamed_file
|
|
|
|
- old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
|
|
|
|
%strong.filename.old
|
|
|
|
= old_path
|
|
|
|
→
|
|
|
|
%strong.filename.new
|
|
|
|
= new_path
|
|
|
|
- else
|
|
|
|
%strong
|
|
|
|
= diff_file.new_path
|
|
|
|
- if diff_file.deleted_file
|
|
|
|
deleted
|
2015-10-24 18:46:33 +05:30
|
|
|
|
2016-01-29 22:53:50 +05:30
|
|
|
- if diff_file.mode_changed?
|
|
|
|
%small
|
|
|
|
= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}"
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2016-01-29 22:53:50 +05:30
|
|
|
.file-actions.hidden-xs
|
2016-01-14 18:37:52 +05:30
|
|
|
- if blob_text_viewable?(blob)
|
2016-01-29 22:53:50 +05:30
|
|
|
= link_to '#', class: 'js-toggle-diff-comments btn active has_tooltip', title: "Toggle comments for this file" do
|
|
|
|
= icon('comments')
|
|
|
|
\
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
- if editable_diff?(diff_file)
|
2015-04-26 12:48:37 +05:30
|
|
|
= edit_blob_link(@merge_request.source_project,
|
|
|
|
@merge_request.source_branch, diff_file.new_path,
|
2016-01-14 18:37:52 +05:30
|
|
|
from_merge_request_id: @merge_request.id)
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
= view_file_btn(diff_commit.id, diff_file, project)
|
2015-04-26 12:48:37 +05:30
|
|
|
|
|
|
|
.diff-content.diff-wrap-lines
|
|
|
|
-# Skipp all non non-supported blobs
|
|
|
|
- return unless blob.respond_to?('text?')
|
2016-01-14 18:37:52 +05:30
|
|
|
- if blob_text_viewable?(blob)
|
2015-11-26 14:37:03 +05:30
|
|
|
- if diff_view == 'parallel'
|
2015-04-26 12:48:37 +05:30
|
|
|
= 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-24 18:46:33 +05:30
|
|
|
- old_file = project.repository.prev_blob_for_diff(diff_commit, diff_file)
|
2015-04-26 12:48:37 +05:30
|
|
|
= render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i
|
|
|
|
- else
|
|
|
|
.nothing-here-block No preview for this file type
|