Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/4976'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jul 11, 2024
2 parents bc8ce57 + 686c512 commit d80fac7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/auth_providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
29 changes: 14 additions & 15 deletions app/views/application/_auth_providers.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<div>
<div class="justify-content-center d-flex align-items-center flex-wrap mb-3" id="login_auth_buttons">
<% 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 -%>
<div>
<%= 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 %>
<div class="justify-content-center d-flex align-items-center flex-wrap w-50">
<div class="col justify-content-center d-flex align-items-center flex-wrap">
<% %w[google facebook microsoft github wikipedia].each do |provider| %>
<% if Settings.key?("#{provider}_auth_id".to_sym) -%>
<% if @preferred_auth_provider == provider %>
Expand All @@ -20,11 +21,9 @@
<% end -%>
<% end -%>
</div>
<div class="justify-content-center d-flex align-items-center flex-wrap gap-2 w-50 px-1">
<% else %>
<div class="justify-content-center d-flex align-items-center flex-wrap gap-2">
<% end %>

<div class="col justify-content-center d-flex align-items-center flex-wrap gap-2">
<%= button_tag image_tag("openid.svg",
:alt => t(".openid.alt"),
:size => "36"),
Expand All @@ -41,7 +40,7 @@
<% end %>
<% end -%>
</div>
</div>
<% end %>

<%# :tabindex starts high to allow rendering at the bottom of the template %>
<%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
Expand Down

0 comments on commit d80fac7

Please sign in to comment.