Commit 396ef600 authored by Peter Hegman's avatar Peter Hegman Committed by Robert Speicher

Fix styling of "Enabled OAuth sign-in sources" checkboxes

Convert to normal checkboxes
parent 2f62d2af
...@@ -102,15 +102,20 @@ module ApplicationSettingsHelper ...@@ -102,15 +102,20 @@ module ApplicationSettingsHelper
def oauth_providers_checkboxes def oauth_providers_checkboxes
button_based_providers.map do |source| button_based_providers.map do |source|
disabled = @application_setting.disabled_oauth_sign_in_sources.include?(source.to_s) 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) name = Gitlab::Auth::OAuth::Provider.label_for(source)
checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]'
checkbox_id = "application_setting_enabled_oauth_sign_in_sources_#{name.parameterize(separator: '_')}"
label_tag(checkbox_name, class: css_class.join(' ')) do content_tag :div, class: 'form-check' do
check_box_tag(checkbox_name, source, !disabled, check_box_tag(
checkbox_name,
source,
!disabled,
autocomplete: 'off', autocomplete: 'off',
id: name.tr(' ', '_')) + name id: checkbox_id,
class: 'form-check-input'
) +
label_tag(checkbox_id, name, class: 'form-check-label')
end end
end end
end end
......
...@@ -20,10 +20,9 @@ ...@@ -20,10 +20,9 @@
or LDAP password or LDAP password
must be used to authenticate. must be used to authenticate.
- if omniauth_enabled? && button_based_providers.any? - if omniauth_enabled? && button_based_providers.any?
.form-group %fieldset.form-group
= f.label :enabled_oauth_sign_in_sources, 'Enabled OAuth sign-in sources', class: 'label-bold' %legend.gl-font-base.gl-mb-3.gl-border-none.gl-font-weight-bold= _('Enabled OAuth sign-in sources')
= hidden_field_tag 'application_setting[enabled_oauth_sign_in_sources][]' = hidden_field_tag 'application_setting[enabled_oauth_sign_in_sources][]'
.btn-group{ data: { toggle: 'buttons' } }
- oauth_providers_checkboxes.each do |source| - oauth_providers_checkboxes.each do |source|
= source = source
.form-group .form-group
......
---
title: Fix styling of "Enabled OAuth sign-in sources" checkboxes
merge_request: 56254
author:
type: fixed
...@@ -11512,6 +11512,9 @@ msgstr "" ...@@ -11512,6 +11512,9 @@ msgstr ""
msgid "Enabled Git access protocols" msgid "Enabled Git access protocols"
msgstr "" msgstr ""
msgid "Enabled OAuth sign-in sources"
msgstr ""
msgid "Enabled sources for code import during project creation. OmniAuth must be configured for GitHub" msgid "Enabled sources for code import during project creation. OmniAuth must be configured for GitHub"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment