]> git.openstreetmap.org Git - rails.git/blob - app/views/application/_auth_providers.html.erb
Extract 3rd party login buttons from login screen
[rails.git] / app / views / application / _auth_providers.html.erb
1 <div>
2   <div class="mb-3">
3     <label class="form-label"><%= t ".with external" %></label>
4
5     <ul class='list-inline' id="login_auth_buttons">
6       <li class="list-inline-item me-3">
7         <%= link_to image_tag("openid.png",
8                               :alt => t("application.auth_providers.openid.title"),
9                               :size => "36"),
10                     "#",
11                     :id => "openid_open_url",
12                     :title => t("application.auth_providers.openid.title") %>
13       </li>
14
15       <% %w[google facebook microsoft github wikipedia].each do |provider| %>
16         <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
17           <li class="list-inline-item me-3"><%= auth_button provider, provider %></li>
18         <% end -%>
19       <% end -%>
20     </ul>
21
22     <%= form_tag(auth_path(:provider => "openid"), :id => "openid_login_form") do %>
23       <div id='login_openid_url' class="mb-3">
24         <label for='openid_url' class="form-label"><%= t ".openid_html", :logo => openid_logo %></label>
25         <%= hidden_field_tag("referer", params[:referer], :autocomplete => "off") %>
26         <%= text_field_tag("openid_url", "", :tabindex => 5, :autocomplete => "on", :class => "openid_url form-control") %>
27         <span class="form-text text-muted">(<a href="<%= t "accounts.edit.openid.link" %>" target="_new"><%= t "accounts.edit.openid.link text" %></a>)</span>
28       </div>
29
30       <%= submit_tag t(".openid_login_button"), :tabindex => 6, :id => "openid_login_button", :class => "btn btn-primary" %>
31     <% end %>
32   </div>
33 </div>