summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-02 14:55:36 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-02 14:55:36 +0100
commit59c3ec4e67f598e1a67df233f2d12fbec3d033dc (patch)
treee37f9958b1706ba8615ded07457162913214d351
parenta3da3d8e3b60f8eeca716ce231ab5670a637e3eb (diff)
downloadgitlab-ce-59c3ec4e67f598e1a67df233f2d12fbec3d033dc.tar.gz
Use file-type specific file icon in blame view and diff item
-rw-r--r--app/views/projects/blame/show.html.haml3
-rw-r--r--app/views/projects/diffs/_file.html.haml20
2 files changed, 15 insertions, 8 deletions
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml
index 6518c4173e1..8d9ec068a43 100644
--- a/app/views/projects/blame/show.html.haml
+++ b/app/views/projects/blame/show.html.haml
@@ -6,7 +6,7 @@
#tree-holder.tree-holder
.file-holder
.file-title
- %i.fa.fa-file
+ = blob_icon @blob.mode, @blob.name
%strong
= @path
%small= number_to_human_size @blob.size
@@ -43,4 +43,3 @@
- blame_group[:lines].each do |line|
:erb
<%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %>
-
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml
index c745b4e69bf..b3392d00e01 100644
--- a/app/views/projects/diffs/_file.html.haml
+++ b/app/views/projects/diffs/_file.html.haml
@@ -2,19 +2,27 @@
.diff-header{id: "file-path-#{hexdigest(diff_file.file_path)}"}
- if diff_file.diff.submodule?
%span
+ = icon('archive fw')
- submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path)
- = submodule_link(submodule_item, @commit.id, project.repository)
+ %strong
+ = submodule_link(submodule_item, @commit.id, project.repository)
- else
%span
+ = blob_icon blob.mode, blob.name
+ = link_to "#diff-#{i}" do
+ %strong
+ = diff_file.new_path
+
- if diff_file.deleted_file
- = "#{diff_file.old_path} deleted"
+ deleted
- elsif diff_file.renamed_file
- = "#{diff_file.old_path} renamed to #{diff_file.new_path}"
- - else
- = diff_file.new_path
+ renamed from
+ %strong
+ = diff_file.old_path
- if diff_file.mode_changed?
- %span.file-mode= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}"
+ %small
+ = "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}"
.diff-controls
- if blob.text?