diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-02 14:08:59 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-02 14:08:59 +0100 |
commit | d65647e90c25a1cf28353b3d0476aec0a4c6ebb7 (patch) | |
tree | 617ca9bafcdf6df5b83158d95464ad3a85a3eda1 /app/helpers/icons_helper.rb | |
parent | 085e45a81cbdac73f41702764a1b53a56a298653 (diff) | |
download | gitlab-ce-d65647e90c25a1cf28353b3d0476aec0a4c6ebb7.tar.gz |
Add visibility description tooltip to snippet and project visibility labels
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r-- | app/helpers/icons_helper.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index 1cf5b96481a..5724d3aabec 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -27,16 +27,20 @@ module IconsHelper end end - def public_icon - icon('globe fw') - end - - def internal_icon - icon('shield fw') - end + def visibility_level_icon(level, fw: true) + name = + case level + when Gitlab::VisibilityLevel::PRIVATE + 'lock' + when Gitlab::VisibilityLevel::INTERNAL + 'shield' + else # Gitlab::VisibilityLevel::PUBLIC + 'globe' + end + + name << " fw" if fw - def private_icon - icon('lock fw') + icon(name) end def file_type_icon_class(type, mode, name) |