From: Tom Hughes Date: Thu, 11 Jul 2024 17:16:03 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/4976' X-Git-Tag: live~323 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d80fac7ad90bfd20d1ad66fba034c2a93e5713d2?hp=bc8ce5729da0a7df4306ae5f785f68980a9bf47b Merge remote-tracking branch 'upstream/pull/4976' --- diff --git a/app/assets/javascripts/auth_providers.js b/app/assets/javascripts/auth_providers.js index 3dd7601a0..75eca253e 100644 --- a/app/assets/javascripts/auth_providers.js +++ b/app/assets/javascripts/auth_providers.js @@ -11,7 +11,7 @@ $(document).ready(function () { // Add click handler to show OpenID field $("#openid_open_url").click(function () { $("#openid_url").val("http://"); - $("#login_auth_buttons").hide().removeClass("d-flex"); + $("#login_auth_buttons").hide(); $("#login_openid_url").show(); $("#openid_login_button").show(); }); diff --git a/app/views/application/_auth_providers.html.erb b/app/views/application/_auth_providers.html.erb index bdd0c474a..ddf143d96 100644 --- a/app/views/application/_auth_providers.html.erb +++ b/app/views/application/_auth_providers.html.erb @@ -1,17 +1,18 @@ -
-
+<% prefered_auth_button_available = false %> +<% %w[google facebook microsoft github wikipedia].each do |provider| %> + <% if Settings.key?("#{provider}_auth_id".to_sym) -%> + <% if @preferred_auth_provider == provider %> + <% prefered_auth_button_available = true %> + <% end %> + <% end -%> +<% end -%> - <% prefered_auth_button_available = false %> - <% %w[google facebook microsoft github wikipedia].each do |provider| %> - <% if Settings.key?("#{provider}_auth_id".to_sym) -%> - <% if @preferred_auth_provider == provider %> - <% prefered_auth_button_available = true %> - <% end %> - <% end -%> - <% end -%> +
+ <%= tag.div :id => "login_auth_buttons", + :class => ["row row-cols-1", { "row-cols-sm-2" => prefered_auth_button_available }, "g-2 mb-3"] do %> <% if prefered_auth_button_available %> -
+
<% %w[google facebook microsoft github wikipedia].each do |provider| %> <% if Settings.key?("#{provider}_auth_id".to_sym) -%> <% if @preferred_auth_provider == provider %> @@ -20,11 +21,9 @@ <% end -%> <% end -%>
-
- <% else %> -
<% end %> +
<%= button_tag image_tag("openid.svg", :alt => t(".openid.alt"), :size => "36"), @@ -41,7 +40,7 @@ <% end %> <% end -%>
-
+ <% end %> <%# :tabindex starts high to allow rendering at the bottom of the template %> <%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>