summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_file_header.html.haml
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-05-25 22:15:57 +0000
committerRobert Speicher <robert@gitlab.com>2017-05-25 22:15:57 +0000
commit8e2fefc6c44fc3c6140e5cbc4b56c58c90dc07f3 (patch)
tree2fe8ce678f1183fe778454dfa39e3dcc277d3fd8 /app/views/projects/diffs/_file_header.html.haml
parente20eb71203aa29458d7f51a27d42a3d8208e2494 (diff)
parentd88a5c1db1c6cca639039188a26c6e6d5bc68831 (diff)
downloadgitlab-ce-8e2fefc6c44fc3c6140e5cbc4b56c58c90dc07f3.tar.gz
Merge branch 'dm-diff-cleanup' into 'master'
Clean up diff rendering See merge request !11390
Diffstat (limited to 'app/views/projects/diffs/_file_header.html.haml')
-rw-r--r--app/views/projects/diffs/_file_header.html.haml16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml
index 4e4fdb73ae3..73c316472e3 100644
--- a/app/views/projects/diffs/_file_header.html.haml
+++ b/app/views/projects/diffs/_file_header.html.haml
@@ -3,19 +3,20 @@
- if show_toggle
%i.fa.diff-toggle-caret.fa-fw
-- if defined?(blob) && blob && diff_file.submodule?
+- if diff_file.submodule?
+ - blob = diff_file.blob
%span
= icon('archive fw')
%strong.file-title-name
- = submodule_link(blob, diff_commit.id, project.repository)
+ = submodule_link(blob, diff_file.content_sha, diff_file.repository)
= copy_file_path_button(blob.path)
- else
= conditional_link_to url.present?, url do
= blob_icon diff_file.b_mode, diff_file.file_path
- - if diff_file.renamed_file
+ - if diff_file.renamed_file?
- old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
%strong.file-title-name.has-tooltip{ data: { title: diff_file.old_path, container: 'body' } }
= old_path
@@ -23,12 +24,13 @@
%strong.file-title-name.has-tooltip{ data: { title: diff_file.new_path, container: 'body' } }
= new_path
- else
- %strong.file-title-name.has-tooltip{ data: { title: diff_file.new_path, container: 'body' } }
- = diff_file.new_path
- - if diff_file.deleted_file
+ %strong.file-title-name.has-tooltip{ data: { title: diff_file.file_path, container: 'body' } }
+ = diff_file.file_path
+
+ - if diff_file.deleted_file?
deleted
- = copy_file_path_button(diff_file.new_path)
+ = copy_file_path_button(diff_file.file_path)
- if diff_file.mode_changed?
%small