diff options
author | Andrei Gliga <otzy_007@yahoo.com> | 2016-05-04 13:33:33 +0300 |
---|---|---|
committer | Andrei Gliga <otzy_007@yahoo.com> | 2016-05-12 13:44:46 +0300 |
commit | cf300443147f1a9ba3acf83ce839afdffa5173bd (patch) | |
tree | 69a2c7a8ffbb0677848c26914dcb6b9cbc7a87c5 /app/helpers | |
parent | d8085d8e128e4ef50443f7a58bfbe7bf21565ab0 (diff) | |
download | gitlab-ce-cf300443147f1a9ba3acf83ce839afdffa5173bd.tar.gz |
OAuth Providers disable from the ApplicationSettings page
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 914b0ef6042..17d73899878 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -60,4 +60,19 @@ module ApplicationSettingsHelper end end end + + def oauth_providers_checkboxes(help_block_id) + button_based_providers.map do |source| + checked = current_application_settings.disabled_oauth_sign_in_sources.include?(source.to_s) + css_class = 'btn' + css_class += ' active' if checked + checkbox_name = 'application_setting[disabled_oauth_sign_in_sources][]' + + label_tag(checkbox_name, class: css_class) do + check_box_tag(checkbox_name, source, checked, + autocomplete: 'off', + 'aria-describedby' => help_block_id) + Gitlab::OAuth::Provider.label_for(source) + end + end + end end |