summaryrefslogtreecommitdiff
path: root/app/helpers/tree_helper.rb
diff options
context:
space:
mode:
authorSullivan SENECHAL <soullivaneuh@gmail.com>2014-10-04 12:29:18 +0200
committerSullivan SENECHAL <soullivaneuh@gmail.com>2015-03-28 16:49:05 +0100
commit8ef7220c2316810e2a9bd784f22d25b4a073c138 (patch)
treec4a0398366e34aca7620ff7417fb44564392630d /app/helpers/tree_helper.rb
parentdb948ff3d6a72620391c7cb0f169334cef0438c7 (diff)
downloadgitlab-ce-8ef7220c2316810e2a9bd784f22d25b4a073c138.tar.gz
Improve file icons rendering on tree
Diffstat (limited to 'app/helpers/tree_helper.rb')
-rw-r--r--app/helpers/tree_helper.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index bf6726574ec..6dd9b6f017c 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -34,12 +34,13 @@ module TreeHelper
end
end
- # Return an image icon depending on the file type
+ # Return an image icon depending on the file type and mode
#
# type - String type of the tree item; either 'folder' or 'file'
- def tree_icon(type)
- icon_class = type == 'folder' ? 'folder' : 'file-o'
- icon(icon_class)
+ # mode - File unix mode
+ # name - File name
+ def tree_icon(type, mode, name)
+ icon("#{file_type_icon_class(type, mode, name)} fw")
end
def tree_hex_class(content)