diff options
Diffstat (limited to 'app/views/devise/shared')
6 files changed, 8 insertions, 14 deletions
diff --git a/app/views/devise/shared/_error_messages.html.haml b/app/views/devise/shared/_error_messages.html.haml index b7589a4460e..caebda72b9c 100644 --- a/app/views/devise/shared/_error_messages.html.haml +++ b/app/views/devise/shared/_error_messages.html.haml @@ -3,7 +3,7 @@ variant: :danger, dismissible: false, alert_options: { id: 'error_explanation', class: 'gl-mb-3'}) do |c| - = c.body do + - c.with_body do %ul.gl-pl-4 - resource.errors.full_messages.each do |message| %li= message diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml index 14a9bde2d9e..8f2c2c58790 100644 --- a/app/views/devise/shared/_omniauth_box.html.haml +++ b/app/views/devise/shared/_omniauth_box.html.haml @@ -18,5 +18,5 @@ = label_for_provider(provider) - if render_remember_me = render Pajamas::CheckboxTagComponent.new(name: 'remember_me_omniauth', value: nil) do |c| - = c.label do + - c.with_label do = _('Remember me') diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 31c541eebde..684ade87720 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -1,11 +1,9 @@ - max_first_name_length = max_last_name_length = 127 -- omniauth_providers_placement ||= :bottom - borderless ||= false - form_resource_name = "new_#{resource_name}" .gl-mb-3.gl-p-4{ class: (borderless ? '' : 'gl-border-gray-100 gl-border-1 gl-border-solid gl-rounded-base') } - - if show_omniauth_providers && omniauth_providers_placement == :top - = render 'devise/shared/signup_omniauth_providers_top' + = yield :omniauth_providers_top if show_omniauth_providers = gitlab_ui_form_for(resource, as: form_resource_name, url: url, html: { class: 'new_user gl-show-field-errors js-arkose-labs-form', 'aria-live' => 'assertive' }, data: { testid: 'signup-form' }) do |f| .devise-errors @@ -77,5 +75,5 @@ .gl-pt-5 = markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text) = render 'devise/shared/terms_of_service_notice', button_text: button_text - - if show_omniauth_providers && omniauth_providers_placement == :bottom - = render 'devise/shared/signup_omniauth_providers' + + = yield :omniauth_providers_bottom if show_omniauth_providers diff --git a/app/views/devise/shared/_signup_omniauth_provider_list.haml b/app/views/devise/shared/_signup_omniauth_provider_list.haml index 6294a93808b..e8c82e456ae 100644 --- a/app/views/devise/shared/_signup_omniauth_provider_list.haml +++ b/app/views/devise/shared/_signup_omniauth_provider_list.haml @@ -1,11 +1,10 @@ -- register_omniauth_params = { intent: :register } - if Feature.enabled?(:restyle_login_page, @project) .gl-text-center.gl-pt-5 %label.gl-font-weight-normal = _("Register with:") .gl-text-center.gl-ml-auto.gl-mr-auto - providers.each do |provider| - = link_to omniauth_authorize_path(:user, provider, register_omniauth_params), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do + = button_to omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider, track_action: "#{provider}_sso", track_label: tracking_label }, id: "oauth-login-#{provider}" do - if provider_has_icon?(provider) = provider_image_tag(provider) %span.gl-button-text @@ -15,7 +14,7 @@ = _("Create an account using:") .gl-display-flex.gl-justify-content-between.gl-flex-wrap - providers.each do |provider| - = link_to omniauth_authorize_path(:user, provider, register_omniauth_params), method: :post, class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider }, id: "oauth-login-#{provider}" do + = button_to omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), class: "btn gl-button btn-default gl-w-full gl-mb-4 js-oauth-login #{qa_selector_for_provider(provider)}", data: { provider: provider, track_action: "#{provider}_sso", track_label: tracking_label }, id: "oauth-login-#{provider}" do - if provider_has_icon?(provider) = provider_image_tag(provider) %span.gl-button-text diff --git a/app/views/devise/shared/_signup_omniauth_providers.haml b/app/views/devise/shared/_signup_omniauth_providers.haml index d2a47974e01..5ec3c7a4150 100644 --- a/app/views/devise/shared/_signup_omniauth_providers.haml +++ b/app/views/devise/shared/_signup_omniauth_providers.haml @@ -1,4 +1,4 @@ - if Feature.disabled?(:restyle_login_page, @project) .omniauth-divider.gl-display-flex.gl-align-items-center = _("or") -= render 'devise/shared/signup_omniauth_provider_list', providers: enabled_button_based_providers += render 'devise/shared/signup_omniauth_provider_list', providers: enabled_button_based_providers, tracking_label: "free_registration" diff --git a/app/views/devise/shared/_signup_omniauth_providers_top.haml b/app/views/devise/shared/_signup_omniauth_providers_top.haml deleted file mode 100644 index 8eb22c0b023..00000000000 --- a/app/views/devise/shared/_signup_omniauth_providers_top.haml +++ /dev/null @@ -1,3 +0,0 @@ -= render 'devise/shared/signup_omniauth_provider_list', providers: popular_enabled_button_based_providers -.omniauth-divider.gl-display-flex.gl-align-items-center - = _("or") |