From cf300443147f1a9ba3acf83ce839afdffa5173bd Mon Sep 17 00:00:00 2001 From: Andrei Gliga Date: Wed, 4 May 2016 13:33:33 +0300 Subject: OAuth Providers disable from the ApplicationSettings page --- app/helpers/application_settings_helper.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/helpers/application_settings_helper.rb') 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 -- cgit v1.2.1 From 7818f7329a436d86b30dff003b60ab8a15a4f0db Mon Sep 17 00:00:00 2001 From: Andrei Gliga Date: Tue, 10 May 2016 11:29:19 +0300 Subject: On Application Settings Page let the user select the enabled OAuth Sign in sources instead of the disabled ones --- app/helpers/application_settings_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/helpers/application_settings_helper.rb') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 17d73899878..ced8e16de74 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -63,13 +63,13 @@ module ApplicationSettingsHelper 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) + disabled = 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][]' + css_class += ' active' unless disabled + checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]' label_tag(checkbox_name, class: css_class) do - check_box_tag(checkbox_name, source, checked, + check_box_tag(checkbox_name, source, !disabled, autocomplete: 'off', 'aria-describedby' => help_block_id) + Gitlab::OAuth::Provider.label_for(source) end -- cgit v1.2.1 From 46064cb84c579bd1657baffe24f5a515759bff67 Mon Sep 17 00:00:00 2001 From: Andrei Gliga Date: Tue, 10 May 2016 18:50:03 +0300 Subject: << instead of += --- app/helpers/application_settings_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/helpers/application_settings_helper.rb') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index ced8e16de74..878b1b254ce 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -65,7 +65,7 @@ module ApplicationSettingsHelper button_based_providers.map do |source| disabled = current_application_settings.disabled_oauth_sign_in_sources.include?(source.to_s) css_class = 'btn' - css_class += ' active' unless disabled + css_class << ' active' unless disabled checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]' label_tag(checkbox_name, class: css_class) do -- cgit v1.2.1 From 9079b56bf4f149054e347aa09ad151ab617ef123 Mon Sep 17 00:00:00 2001 From: Andrei Gliga Date: Wed, 11 May 2016 10:35:18 +0300 Subject: Revert "no need to show the help about Github or the other authentication sources" This reverts commit 78a832d0fd7ff445c707809134dbb2a42d2a9e03. Show help only for the enabled OAuth Providers on oauth-providers-help block aria: { describedby: help_block_id } instead of 'aria-describedby' => help_block_id provider and not p a more simple approach to the OmniAuth helper links for oauth-providers-help --- app/helpers/application_settings_helper.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/helpers/application_settings_helper.rb') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 878b1b254ce..82056a4c977 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -71,8 +71,15 @@ module ApplicationSettingsHelper label_tag(checkbox_name, class: css_class) do check_box_tag(checkbox_name, source, !disabled, autocomplete: 'off', - 'aria-describedby' => help_block_id) + Gitlab::OAuth::Provider.label_for(source) + aria: { describedby: help_block_id }) + Gitlab::OAuth::Provider.label_for(source) end end end + + def oauth_providers_with_help_links + button_based_providers.map do |provider| + Gitlab::OAuth::Provider.label_for(provider) + ' ' + + link_to("(?)", help_page_path("integration", provider)) + end + end end -- cgit v1.2.1 From 6cdce04937837de8014b1c044c91ed5b32bdc90a Mon Sep 17 00:00:00 2001 From: Andrei Gliga Date: Thu, 12 May 2016 13:40:24 +0300 Subject: Revert "Revert "no need to show the help about Github or the other authentication sources"" This reverts commit 075ace5686c63d40f7e9fa02bf37e1bd3168f7e7. --- app/helpers/application_settings_helper.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'app/helpers/application_settings_helper.rb') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 82056a4c977..878b1b254ce 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -71,15 +71,8 @@ module ApplicationSettingsHelper label_tag(checkbox_name, class: css_class) do check_box_tag(checkbox_name, source, !disabled, autocomplete: 'off', - aria: { describedby: help_block_id }) + Gitlab::OAuth::Provider.label_for(source) + 'aria-describedby' => help_block_id) + Gitlab::OAuth::Provider.label_for(source) end end end - - def oauth_providers_with_help_links - button_based_providers.map do |provider| - Gitlab::OAuth::Provider.label_for(provider) + ' ' + - link_to("(?)", help_page_path("integration", provider)) - end - end end -- cgit v1.2.1 From 260c88a75865a1b849a4bac8a14c897fbe522047 Mon Sep 17 00:00:00 2001 From: Andrei Gliga Date: Thu, 12 May 2016 13:43:12 +0300 Subject: no need to define the help block since there's no help block --- app/helpers/application_settings_helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'app/helpers/application_settings_helper.rb') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 878b1b254ce..03080d25931 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -61,7 +61,7 @@ module ApplicationSettingsHelper end end - def oauth_providers_checkboxes(help_block_id) + def oauth_providers_checkboxes button_based_providers.map do |source| disabled = current_application_settings.disabled_oauth_sign_in_sources.include?(source.to_s) css_class = 'btn' @@ -70,8 +70,7 @@ module ApplicationSettingsHelper label_tag(checkbox_name, class: css_class) do check_box_tag(checkbox_name, source, !disabled, - autocomplete: 'off', - 'aria-describedby' => help_block_id) + Gitlab::OAuth::Provider.label_for(source) + autocomplete: 'off') + Gitlab::OAuth::Provider.label_for(source) end end end -- cgit v1.2.1 From 40b6d9064a2ab6c89cb54b62536fe2952c6cbca6 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 9 May 2016 16:12:53 +0100 Subject: Allow custom text on 'almost there' page Add a new application setting, after_sign_up_text. This is text to be rendered as Markdown and shown on the 'almost there' page after a user signs up, but before they've confirmed their account. Tweak the styles for that page so that centered lists look reasonable. --- app/helpers/application_settings_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/helpers/application_settings_helper.rb') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 03080d25931..55313fd8357 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -15,6 +15,10 @@ module ApplicationSettingsHelper current_application_settings.sign_in_text end + def after_sign_up_text + current_application_settings.after_sign_up_text + end + def shared_runners_text current_application_settings.shared_runners_text end -- cgit v1.2.1