summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-01-19 13:03:18 +0000
committerFatih Acet <acetfatih@gmail.com>2017-01-19 13:03:18 +0000
commit97475d0b8d1b82353bbba9caa2b1ce4f43d5676b (patch)
tree8cb472059281a0b069ebddc14f20b5ffc5bfb6e2 /app/helpers
parent5ba18c58df182f656340b0ea192f20ede34e2e6d (diff)
parent2c9bb135057f4fea43aa0be5b94354f288d5070f (diff)
downloadgitlab-ce-97475d0b8d1b82353bbba9caa2b1ce4f43d5676b.tar.gz
Merge branch '24032-changed-visibility-level-to-public-but-project-is-not-public' into 'master'
Update project visibility level ui to use dropdowns Closes #24296, #24123, and #24032 See merge request !7645
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/projects_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index c6c63918fa5..eb98204285d 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -409,4 +409,15 @@ module ProjectsHelper
def project_issues(project)
IssuesFinder.new(current_user, project_id: project.id).execute
end
+
+ def visibility_select_options(project, selected_level)
+ levels_options_array = Gitlab::VisibilityLevel.values.map do |level|
+ [
+ visibility_level_label(level),
+ { data: { description: visibility_level_description(level, project) } },
+ level
+ ]
+ end
+ options_for_select(levels_options_array, selected_level)
+ end
end