diff options
author | Valery Sizov <valery@gitlab.com> | 2014-10-08 17:44:25 +0400 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2014-10-09 18:09:53 +0400 |
commit | 47f539f5a6a930b2cfd4f9834b4d1bd5e1c180cb (patch) | |
tree | 0b528d431aa1625d92d3598f6a86ef8aa93b6491 /app/helpers/visibility_level_helper.rb | |
parent | f7dc15c6bdb75a5f611c389ece3fe251f94a2d8f (diff) |
Snippets: public/internal/private
Diffstat (limited to 'app/helpers/visibility_level_helper.rb')
-rw-r--r-- | app/helpers/visibility_level_helper.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 8b83b8ff640..deb9c8b4d49 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -28,6 +28,23 @@ module VisibilityLevelHelper end end + def snippet_visibility_level_description(level) + capture_haml do + haml_tag :span do + case level + when Gitlab::VisibilityLevel::PRIVATE + haml_concat "The snippet is visible only for me" + when Gitlab::VisibilityLevel::INTERNAL + haml_concat "The snippet is visible for any logged in user." + when Gitlab::VisibilityLevel::PUBLIC + haml_concat "The snippet can be accessed" + haml_concat "without any" + haml_concat "authentication." + end + end + end + end + def visibility_level_icon(level) case level when Gitlab::VisibilityLevel::PRIVATE |