diff options
Diffstat (limited to 'app/views/devise/shared')
9 files changed, 36 insertions, 59 deletions
diff --git a/app/views/devise/shared/_footer.html.haml b/app/views/devise/shared/_footer.html.haml index c35e43b909e..44f34e3f342 100644 --- a/app/views/devise/shared/_footer.html.haml +++ b/app/views/devise/shared/_footer.html.haml @@ -7,5 +7,8 @@ = link_to _("Help"), help_path = link_to _("About GitLab"), "https://#{ApplicationHelper.promo_host}" = link_to _("Community forum"), ApplicationHelper.community_forum, target: '_blank', class: 'text-nowrap', rel: 'noopener noreferrer' + - if one_trust_enabled? + = render Pajamas::ButtonComponent.new(category: :tertiary, size: :small, button_options: { class: 'ot-sdk-show-settings' }) do + = _("Cookie Preferences") = render 'devise/shared/language_switcher' = footer_message diff --git a/app/views/devise/shared/_omniauth_box.html.haml b/app/views/devise/shared/_omniauth_box.html.haml index 45062745b77..8197abcc787 100644 --- a/app/views/devise/shared/_omniauth_box.html.haml +++ b/app/views/devise/shared/_omniauth_box.html.haml @@ -1,21 +1,16 @@ - render_remember_me = remember_me_enabled? && local_assigns.fetch(:render_remember_me, true) -- restyle_login_page_enabled = Feature.enabled?(:restyle_login_page, @project) -- if restyle_login_page_enabled && (any_form_based_providers_enabled? || password_authentication_enabled_for_web?) +- if any_form_based_providers_enabled? || password_authentication_enabled_for_web? .omniauth-divider.gl-display-flex.gl-align-items-center = _("or sign in with") -.gl-mt-5.gl-px-5{ class: restyle_login_page_enabled ? 'omniauth-container gl-text-center gl-ml-auto gl-mr-auto' : 'omniauth-container gl-py-5' } - - if !restyle_login_page_enabled - %label.gl-font-weight-bold - = _('Sign in with') +.gl-mt-5.gl-px-5.gl-text-center.gl-display-flex.gl-flex-direction-column.gl-gap-3.js-oauth-login - enabled_button_based_providers.each do |provider| - - has_icon = provider_has_icon?(provider) - = button_to omniauth_authorize_path(:user, provider), id: "oauth-login-#{provider}", data: { testid: "#{test_id_for_provider(provider)}" }, class: "btn gl-button btn-default gl-mb-2 js-oauth-login gl-w-full", form: { class: restyle_login_page_enabled ? 'gl-mb-3' : 'gl-w-full gl-mb-3' } do - - if has_icon - = provider_image_tag(provider) - %span.gl-button-text - = label_for_provider(provider) + = render 'devise/shared/omniauth_provider_button', + href: omniauth_authorize_path(:user, provider), + provider: provider, + data: { testid: test_id_for_provider(provider) }, + id: "oauth-login-#{provider}" - if render_remember_me = render Pajamas::CheckboxTagComponent.new(name: 'remember_me_omniauth', value: nil) do |c| - c.with_label do diff --git a/app/views/devise/shared/_omniauth_provider_button.haml b/app/views/devise/shared/_omniauth_provider_button.haml new file mode 100644 index 00000000000..c33e2253bb1 --- /dev/null +++ b/app/views/devise/shared/_omniauth_provider_button.haml @@ -0,0 +1,7 @@ +- button_options = { class: local_assigns.fetch(:classes, nil) || nil, data: data, id: id } + += render Pajamas::ButtonComponent.new(href: href, method: :post, form: true, block: true, button_options: button_options) do + - if provider_has_icon?(provider) + = provider_image_tag(provider) + %span.gl-button-text + = label_for_provider(provider) diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index fb60b8c08eb..9eb0b773ebb 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -1,10 +1,7 @@ -- borderless ||= false - -.gl-mb-3.gl-p-4{ class: (borderless ? '' : 'gl-border-gray-100 gl-border-1 gl-border-solid gl-rounded-base') } +.gl-mb-3.gl-p-4 = yield :omniauth_providers_top if show_omniauth_providers = render 'devise/shared/signup_box_form', button_text: button_text, url: url, show_omniauth_providers: omniauth_enabled? && button_based_providers_enabled? - diff --git a/app/views/devise/shared/_signup_omniauth_provider_button.haml b/app/views/devise/shared/_signup_omniauth_provider_button.haml index 74f009a97d3..9870e90cfff 100644 --- a/app/views/devise/shared/_signup_omniauth_provider_button.haml +++ b/app/views/devise/shared/_signup_omniauth_provider_button.haml @@ -1,8 +1,6 @@ -- data = { provider: provider, track_action: "#{provider}_sso", track_label: tracking_label } -- button_options = { class: 'js-oauth-login', data: data, id: "oauth-login-#{provider}" } - -= render Pajamas::ButtonComponent.new(href: href, method: :post, form: true, block: true, button_options: button_options) do - - if provider_has_icon?(provider) - = provider_image_tag(provider) - %span.gl-button-text - = label_for_provider(provider) += render 'devise/shared/omniauth_provider_button', + href: href, + provider: provider, + classes: 'js-track-omni-auth', + data: { provider: provider, track_action: "#{provider}_sso", track_label: tracking_label }, + id: "oauth-login-#{provider}" diff --git a/app/views/devise/shared/_signup_omniauth_provider_list.haml b/app/views/devise/shared/_signup_omniauth_provider_list.haml index 9916d3fa026..c1026c0f431 100644 --- a/app/views/devise/shared/_signup_omniauth_provider_list.haml +++ b/app/views/devise/shared/_signup_omniauth_provider_list.haml @@ -1,21 +1,9 @@ -- if Feature.enabled?(:restyle_login_page, @project) - .gl-text-center.gl-pt-5 - %label.gl-font-weight-normal - = _("Register with:") - .gl-display-flex.gl-flex-direction-column.gl-gap-3 - - providers.each do |provider| - = render 'devise/shared/signup_omniauth_provider_button', - href: omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), - provider: provider, - tracking_label: tracking_label - - -- else - %label.gl-font-weight-bold - = _("Create an account using:") +.gl-text-center.gl-pt-5 + %label.gl-font-weight-normal + = _("Register with:") .gl-display-flex.gl-flex-direction-column.gl-gap-3 - providers.each do |provider| = render 'devise/shared/signup_omniauth_provider_button', - href: omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), - provider: provider, - tracking_label: tracking_label + href: omniauth_authorize_path(:user, provider, register_omniauth_params(local_assigns)), + provider: provider, + tracking_label: tracking_label diff --git a/app/views/devise/shared/_signup_omniauth_providers.haml b/app/views/devise/shared/_signup_omniauth_providers.haml index 4e62c10b258..263e11ab341 100644 --- a/app/views/devise/shared/_signup_omniauth_providers.haml +++ b/app/views/devise/shared/_signup_omniauth_providers.haml @@ -1,6 +1,3 @@ -- 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, tracking_label: oauth_tracking_label diff --git a/app/views/devise/shared/_tabs_ldap.html.haml b/app/views/devise/shared/_tabs_ldap.html.haml index e6bc38ba6dd..3e9d60da228 100644 --- a/app/views/devise/shared/_tabs_ldap.html.haml +++ b/app/views/devise/shared/_tabs_ldap.html.haml @@ -1,7 +1,7 @@ - show_password_form = local_assigns.fetch(:show_password_form, password_authentication_enabled_for_web?) - render_signup_link = local_assigns.fetch(:render_signup_link, true) -%ul.nav-links.new-session-tabs.nav-tabs.nav{ class: "#{'custom-provider-tabs' if any_form_based_providers_enabled?} #{'nav-links-unboxed' if Feature.enabled?(:restyle_login_page, @project)}" } +%ul.nav-links.new-session-tabs.nav-tabs.nav.nav-links-unboxed - if crowd_enabled? %li.nav-item = link_to _("Crowd"), "#crowd", class: "nav-link #{active_when(form_based_auth_provider_has_active_class?(:crowd))}", 'data-toggle' => 'tab', role: 'tab' diff --git a/app/views/devise/shared/_terms_of_service_notice.html.haml b/app/views/devise/shared/_terms_of_service_notice.html.haml index 3749dc66a04..5d5a5a64c29 100644 --- a/app/views/devise/shared/_terms_of_service_notice.html.haml +++ b/app/views/devise/shared/_terms_of_service_notice.html.haml @@ -1,17 +1,9 @@ - return unless Gitlab::CurrentSettings.current_application_settings.enforce_terms? %p.gl-text-gray-500.gl-mt-5.gl-mb-0 - - if Feature.enabled?(:restyle_login_page, @project) - - if Gitlab.com? - = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the GitLab%{link_start} Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}")) % { button_text: button_text, - link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - - else - = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the%{link_start} Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}")) % { button_text: button_text, - link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } + - if Gitlab.com? + = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the GitLab%{link_start} Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}")) % { button_text: button_text, + link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - else - - if Gitlab.com? - = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the GitLab %{link_start}Terms of Use and Privacy Statement%{link_end}")) % { button_text: button_text, - link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } - - else - = html_escape(s_("SignUp|By clicking %{button_text}, I agree that I have read and accepted the %{link_start}Terms of Use and Privacy Statement%{link_end}")) % { button_text: button_text, - link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } + = html_escape(s_("SignUp|By clicking %{button_text} or registering through a third party you accept the%{link_start} Terms of Use and acknowledge the Privacy Statement and Cookie Policy%{link_end}")) % { button_text: button_text, + link_start: "<a href='#{terms_path}' target='_blank' rel='noreferrer noopener'>".html_safe, link_end: '</a>'.html_safe } |