Commit 59c3ec4e authored by Douwe Maan's avatar Douwe Maan

Use file-type specific file icon in blame view and diff item

parent a3da3d8e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#tree-holder.tree-holder #tree-holder.tree-holder
.file-holder .file-holder
.file-title .file-title
%i.fa.fa-file = blob_icon @blob.mode, @blob.name
%strong %strong
= @path = @path
%small= number_to_human_size @blob.size %small= number_to_human_size @blob.size
...@@ -43,4 +43,3 @@ ...@@ -43,4 +43,3 @@
- blame_group[:lines].each do |line| - blame_group[:lines].each do |line|
:erb :erb
<%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %> <%= highlight(@blob.name, line, nowrap: true, continue: true).html_safe %>
...@@ -2,19 +2,27 @@ ...@@ -2,19 +2,27 @@
.diff-header{id: "file-path-#{hexdigest(diff_file.file_path)}"} .diff-header{id: "file-path-#{hexdigest(diff_file.file_path)}"}
- if diff_file.diff.submodule? - if diff_file.diff.submodule?
%span %span
= icon('archive fw')
- submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path) - 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 - else
%span %span
= blob_icon blob.mode, blob.name
= link_to "#diff-#{i}" do
%strong
= diff_file.new_path
- if diff_file.deleted_file - if diff_file.deleted_file
= "#{diff_file.old_path} deleted" deleted
- elsif diff_file.renamed_file - elsif diff_file.renamed_file
= "#{diff_file.old_path} renamed to #{diff_file.new_path}" renamed from
- else %strong
= diff_file.new_path = diff_file.old_path
- if diff_file.mode_changed? - 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 .diff-controls
- if blob.text? - if blob.text?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment