summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-06-05 06:24:51 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-06-05 06:24:51 +0000
commit6bc89c0e3baf064425a47401ba97d27d8e943a59 (patch)
treefa34aec8b6fdd51f6abcdde07c1f57957813ccc6
parent0bd860525f8766eb7ff9e57b3de925ac91685731 (diff)
parentccc076016df1c4a8a68d518ffbecafdc3ba90139 (diff)
downloadgitlab-ce-6bc89c0e3baf064425a47401ba97d27d8e943a59.tar.gz
Merge branch '47266-visiblity-import-sources-checkbox-styling' into 'master'
Resolve "Admin area > Import sources and restricted visibility level checkboxes styling" Closes #47266 See merge request gitlab-org/gitlab-ce!19397
-rw-r--r--app/helpers/application_settings_helper.rb6
-rw-r--r--app/views/admin/application_settings/_visibility_and_access.html.haml4
2 files changed, 6 insertions, 4 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index adc423af9e1..ef1bf283d0c 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -36,7 +36,7 @@ module ApplicationSettingsHelper
# Return a group of checkboxes that use Bootstrap's button plugin for a
# toggle button effect.
- def restricted_level_checkboxes(help_block_id, checkbox_name)
+ def restricted_level_checkboxes(help_block_id, checkbox_name, options = {})
Gitlab::VisibilityLevel.values.map do |level|
checked = restricted_visibility_levels(true).include?(level)
css_class = checked ? 'active' : ''
@@ -46,6 +46,7 @@ module ApplicationSettingsHelper
check_box_tag(checkbox_name, level, checked,
autocomplete: 'off',
'aria-describedby' => help_block_id,
+ 'class' => options[:class],
id: tag_name) + visibility_level_icon(level) + visibility_level_label(level)
end
end
@@ -53,7 +54,7 @@ module ApplicationSettingsHelper
# Return a group of checkboxes that use Bootstrap's button plugin for a
# toggle button effect.
- def import_sources_checkboxes(help_block_id)
+ def import_sources_checkboxes(help_block_id, options = {})
Gitlab::ImportSources.options.map do |name, source|
checked = Gitlab::CurrentSettings.import_sources.include?(source)
css_class = checked ? 'active' : ''
@@ -63,6 +64,7 @@ module ApplicationSettingsHelper
check_box_tag(checkbox_name, source, checked,
autocomplete: 'off',
'aria-describedby' => help_block_id,
+ 'class' => options[:class],
id: name.tr(' ', '_')) + name
end
end
diff --git a/app/views/admin/application_settings/_visibility_and_access.html.haml b/app/views/admin/application_settings/_visibility_and_access.html.haml
index 2b4d3bab54d..05520bd8d2d 100644
--- a/app/views/admin/application_settings/_visibility_and_access.html.haml
+++ b/app/views/admin/application_settings/_visibility_and_access.html.haml
@@ -23,7 +23,7 @@
.col-sm-10
- checkbox_name = 'application_setting[restricted_visibility_levels][]'
= hidden_field_tag(checkbox_name)
- - restricted_level_checkboxes('restricted-visibility-help', checkbox_name).each do |level|
+ - restricted_level_checkboxes('restricted-visibility-help', checkbox_name, class: 'form-check-input').each do |level|
.form-check
= level
%span.form-text.text-muted#restricted-visibility-help
@@ -33,7 +33,7 @@
= f.label :import_sources, class: 'col-form-label col-sm-2'
.col-sm-10
= hidden_field_tag 'application_setting[import_sources][]'
- - import_sources_checkboxes('import-sources-help').each do |source|
+ - import_sources_checkboxes('import-sources-help', class: 'form-check-input').each do |source|
.form-check= source
%span.form-text.text-muted#import-sources-help
Enabled sources for code import during project creation. OmniAuth must be configured for GitHub