diff options
author | tauriedavis <taurie@gitlab.com> | 2018-06-04 14:55:31 -0700 |
---|---|---|
committer | tauriedavis <taurie@gitlab.com> | 2018-06-04 14:55:31 -0700 |
commit | ccc076016df1c4a8a68d518ffbecafdc3ba90139 (patch) | |
tree | 956ce9e7ecada1b7aa31df5484edf4063d36c80a /app/helpers/application_settings_helper.rb | |
parent | 3571b97effd81f9a84f238f918544c6e5c625b76 (diff) | |
download | gitlab-ce-47266-visiblity-import-sources-checkbox-styling.tar.gz |
Add form-check-input class to checkbox input for visibility levels and import sources in admin area47266-visiblity-import-sources-checkbox-styling
Diffstat (limited to 'app/helpers/application_settings_helper.rb')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 6 |
1 files changed, 4 insertions, 2 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 |