]> git.openstreetmap.org Git - rails.git/blob - app/views/application/_auth_providers.html.erb
Merge remote-tracking branch 'upstream/pull/4455'
[rails.git] / app / views / application / _auth_providers.html.erb
1 <div>
2   <div class="list-inline justify-content-center d-flex align-items-center flex-wrap mb-3 gap-3" id="login_auth_buttons">
3
4     <% %w[google facebook microsoft github wikipedia].each do |provider| %>
5       <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
6         <% if @preferred_auth_provider == provider %>
7           <div class="mx-2"><%= auth_button_preferred provider, provider %></div>
8         <% end %>
9       <% end -%>
10     <% end -%>
11
12     <div class="justify-content-center d-flex gap-1">
13       <div>
14         <%= link_to image_tag("openid.png",
15                               :alt => t("application.auth_providers.openid.title"),
16                               :size => "24"),
17                     "#",
18                     :id => "openid_open_url",
19                     :title => t("application.auth_providers.openid.title"),
20                     :class => "p-2 d-block" %>
21       </div>
22
23       <% %w[google facebook microsoft github wikipedia].each do |provider| %>
24         <% unless @preferred_auth_provider == provider %>
25           <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
26             <div><%= auth_button provider, provider %></div>
27           <% end -%>
28         <% end %>
29       <% end -%>
30     </div>
31   </div>
32
33   <%# :tabindex starts high to allow rendering at the bottom of the template %>
34   <%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
35     <div id="login_openid_url" class="mb-3">
36       <label for="openid_url" class="form-label"><%= t ".openid_html", :logo => openid_logo %></label>
37       <%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %>
38       <%= text_field_tag("openid_url", "", :tabindex => 20, :autocomplete => "on", :class => "openid_url form-control") %>
39       <span class="form-text text-muted">(<a href="<%= t "accounts.edit.openid.link" %>" target="_new"><%= t "accounts.edit.openid.link text" %></a>)</span>
40     </div>
41
42     <%= submit_tag t(".openid_login_button"), :tabindex => 21, :id => "openid_login_button", :class => "btn btn-primary" %>
43   <% end %>
44 </div>