diff options
Diffstat (limited to 'app/helpers/application_settings_helper.rb')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 30ae535b06f..085fbfd08da 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -37,13 +37,8 @@ module ApplicationSettingsHelper end def storage_weights - ApplicationSetting.repository_storages_weighted_attributes.map do |attribute| - storage = attribute.to_s.delete_prefix('repository_storages_weighted_') - { - name: attribute, - label: storage, - value: @application_setting.repository_storages_weighted[storage] || 0 - } + Gitlab.config.repositories.storages.keys.each_with_object(OpenStruct.new) do |storage, weights| + weights[storage.to_sym] = @application_setting.repository_storages_weighted[storage] || 0 end end @@ -107,15 +102,20 @@ module ApplicationSettingsHelper def oauth_providers_checkboxes button_based_providers.map do |source| disabled = @application_setting.disabled_oauth_sign_in_sources.include?(source.to_s) - css_class = ['btn'] - css_class << 'active' unless disabled - checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]' name = Gitlab::Auth::OAuth::Provider.label_for(source) - - label_tag(checkbox_name, class: css_class.join(' ')) do - check_box_tag(checkbox_name, source, !disabled, - autocomplete: 'off', - id: name.tr(' ', '_')) + name + checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]' + checkbox_id = "application_setting_enabled_oauth_sign_in_sources_#{name.parameterize(separator: '_')}" + + content_tag :div, class: 'form-check' do + check_box_tag( + checkbox_name, + source, + !disabled, + autocomplete: 'off', + id: checkbox_id, + class: 'form-check-input' + ) + + label_tag(checkbox_id, name, class: 'form-check-label') end end end @@ -252,6 +252,7 @@ module ApplicationSettingsHelper :housekeeping_incremental_repack_period, :html_emails_enabled, :import_sources, + :in_product_marketing_emails_enabled, :invisible_captcha_enabled, :max_artifacts_size, :max_attachment_size, |