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
path: root/app/views
diff options
context:
space:
mode:
authorLuke Bennett <lbennett@gitlab.com>2019-06-29 00:38:26 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-07-15 19:00:55 +0300
commit9b40fc7416c55625f46139f89f0dff3b028a30c0 (patch)
tree91ab62a693b74a8637ce1b5cd653c40bde0897c6 /app/views
parent96277bb9d61b5aaf5c2edc388c5eabfc743478f0 (diff)
Hide restricted and disallowed visibility radios
Show a message if many levels are restricted and a different message if all levels are restricted.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/shared/_visibility_radios.html.haml18
1 files changed, 10 insertions, 8 deletions
diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml
index 9fc46afe177..342fdb20d41 100644
--- a/app/views/shared/_visibility_radios.html.haml
+++ b/app/views/shared/_visibility_radios.html.haml
@@ -1,17 +1,19 @@
- Gitlab::VisibilityLevel.values.each do |level|
- disallowed = disallowed_visibility_level?(form_model, level)
- restricted = restricted_visibility_levels.include?(level)
- - disabled = disallowed || restricted
- .form-check{ class: [('disabled' if disabled), ('restricted' if restricted)] }
- = form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled, class: 'form-check-input', data: { track_label: "blank_project", track_event: "activate_form_input", track_property: "#{model_method}", track_value: "#{level}" }
+ - next if disallowed || restricted
+
+ .form-check
+ = form.radio_button model_method, level, checked: (selected_level == level), class: 'form-check-input', data: { track_label: "blank_project", track_event: "activate_form_input", track_property: "#{model_method}", track_value: "#{level}" }
= form.label "#{model_method}_#{level}", class: 'form-check-label' do
= visibility_level_icon(level)
.option-title
= visibility_level_label(level)
.option-description
= visibility_level_description(level, form_model)
- .option-disabled-reason
- - if restricted
- = restricted_visibility_level_description(level)
- - elsif disallowed
- = disallowed_visibility_level_description(level, form_model)
+
+.text-muted
+ - if all_visibility_levels_restricted?
+ = _('Visibility settings have been disabled by the administrator.')
+ - elsif multiple_visibility_levels_restricted?
+ = _('Other visibility settings have been disabled by the administrator.')