Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-04-26 08:01:52 +0300
committerVinnie Okada <vokada@mrvinn.com>2015-04-26 16:48:19 +0300
commitbd557e4b64a733f4be64b8cf36b8a551d8e8bab7 (patch)
treebbcfbe5bd73b157755254f9270c0601be4ab74f0 /app/views/projects
parent439b9f50af3168d33169a4cd25b59e45ea46dc62 (diff)
Add new admin settings
Add new global application settings for default project and snippet visibility levels.
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/_visibility_level.html.haml27
-rw-r--r--app/views/projects/edit.html.haml2
-rw-r--r--app/views/projects/new.html.haml2
-rw-r--r--app/views/projects/snippets/edit.html.haml2
-rw-r--r--app/views/projects/snippets/new.html.haml2
5 files changed, 4 insertions, 31 deletions
diff --git a/app/views/projects/_visibility_level.html.haml b/app/views/projects/_visibility_level.html.haml
deleted file mode 100644
index 42c8e685224..00000000000
--- a/app/views/projects/_visibility_level.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-.form-group.project-visibility-level-holder
- = f.label :visibility_level, class: 'control-label' do
- Visibility Level
- = link_to "(?)", help_page_path("public_access", "public_access")
- .col-sm-10
- - if can_change_visibility_level
- - Gitlab::VisibilityLevel.values.each do |level|
- .radio
- - restricted = restricted_visibility_levels.include?(level)
- = label :project_visibility_level, level do
- = f.radio_button :visibility_level, level, checked: (visibility_level == level), disabled: restricted
- = visibility_level_icon(level)
- .option-title
- = visibility_level_label(level)
- .option-descr
- = visibility_level_description(level)
- - unless restricted_visibility_levels.empty?
- .col-sm-10
- %span.info
- Some visibility level settings have been restricted by the administrator.
- - else
- .col-sm-10
- %span.info
- = visibility_level_icon(visibility_level)
- %strong
- = visibility_level_label(visibility_level)
- .light= visibility_level_description(visibility_level)
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index fbf04847e48..c09d794ef7f 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -29,7 +29,7 @@
.col-sm-10= f.select(:default_branch, @repository.branch_names, {}, {class: 'select2 select-wide'})
- = render "visibility_level", f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can?(current_user, :change_visibility_level, @project)
+ = render 'shared/visibility_level', f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can?(current_user, :change_visibility_level, @project), form_model: @project
.form-group
= f.label :tag_list, "Tags", class: 'control-label'
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index a06c85b4251..47c69f89a97 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -93,7 +93,7 @@
%span.light (optional)
.col-sm-10
= f.text_area :description, placeholder: "Awesome project", class: "form-control", rows: 3, maxlength: 250, tabindex: 3
- = render "visibility_level", f: f, visibility_level: gitlab_config.default_projects_features.visibility_level, can_change_visibility_level: true
+ = render 'shared/visibility_level', f: f, visibility_level: default_project_visibility, can_change_visibility_level: true, form_model: @project
.form-actions
= f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4
diff --git a/app/views/projects/snippets/edit.html.haml b/app/views/projects/snippets/edit.html.haml
index 2d4d5d030ab..7baddebde45 100644
--- a/app/views/projects/snippets/edit.html.haml
+++ b/app/views/projects/snippets/edit.html.haml
@@ -1,4 +1,4 @@
%h3.page-title
Edit snippet
%hr
-= render "shared/snippets/form", url: namespace_project_snippet_path(@project.namespace, @project, @snippet)
+= render "shared/snippets/form", url: namespace_project_snippet_path(@project.namespace, @project, @snippet), visibility_level: @snippet.visibility_level
diff --git a/app/views/projects/snippets/new.html.haml b/app/views/projects/snippets/new.html.haml
index bb659dba0cf..5efe662665e 100644
--- a/app/views/projects/snippets/new.html.haml
+++ b/app/views/projects/snippets/new.html.haml
@@ -1,4 +1,4 @@
%h3.page-title
New snippet
%hr
-= render "shared/snippets/form", url: namespace_project_snippets_path(@project.namespace, @project, @snippet)
+= render "shared/snippets/form", url: namespace_project_snippets_path(@project.namespace, @project, @snippet), visibility_level: default_snippet_visibility