]> git.openstreetmap.org Git - rails.git/blob - app/views/sessions/new.html.erb
Merge remote-tracking branch 'upstream/pull/4764'
[rails.git] / app / views / sessions / new.html.erb
1 <% content_for :head do %>
2   <%= javascript_include_tag "login" %>
3   <%= javascript_include_tag "auth_providers" %>
4 <% end %>
5
6 <% content_for :heading_class, "p-0 mw-100" %>
7
8 <% content_for :heading do %>
9   <% if @client_app_name %>
10     <p class="text-center text-muted fs-6 py-2 mb-0 bg-white"><%= t(".login_to_authorize_html", :client_app_name => @client_app_name) %></p>
11   <% end %>
12
13   <div class="header-illustration new-user-main auth-container mx-auto">
14     <ul class="nav nav-tabs position-absolute bottom-0 px-3 fs-6 w-100">
15       <li class="nav-item">
16         <%= link_to t("sessions.new.tab_title"), "#", :class => "nav-link active" %>
17       </li>
18       <li class="nav-item">
19         <%= link_to t("users.new.tab_title"), url_for(:action => :new, :controller => :users), :class => "nav-link" %>
20       </li>
21     </ul>
22   </div>
23 <% end %>
24
25 <div id="login_login" class="auth-container mx-auto my-0">
26   <% if @preferred_auth_provider %>
27     <%= render :partial => "auth_providers" %>
28     <div class="d-flex justify-content-center align-items-center">
29       <div class="border-bottom border-1 flex-grow-1"></div>
30       <div class="text-secondary mx-3"><%= t ".or" %></div>
31       <div class="border-bottom border-1 flex-grow-1"></div>
32     </div>
33   <% end %>
34
35   <%= bootstrap_form_tag(:action => "login", :html => { :id => "login_form" }) do |f| %>
36     <%= hidden_field_tag("referer", h(params[:referer]), :autocomplete => "off") %>
37
38     <%= f.text_field :username, :label => t(".email or username"), :tabindex => 1, :value => params[:username] %>
39
40     <div class="row">
41       <div class="col">
42         <%= f.label :password, :class => "form-label" %>
43       </div>
44       <div class="col text-end">
45         <small><%= link_to(t(".lost password link"), user_forgot_password_path) %></small>
46       </div>
47     </div>
48     <input class="form-control mb-3" type="password" name="password" id="password" tabindex="2" value="" autocomplete="off" />
49
50     <%= f.form_group do %>
51       <%= f.check_box :remember_me, { :label => t(".remember"), :tabindex => 3, :checked => (params[:remember_me] == "yes") }, "yes" %>
52     <% end %>
53
54     <div class="mb-3">
55       <%= f.primary t(".login_button"), :tabindex => 4 %>
56     </div>
57   <% end %>
58
59   <% unless @preferred_auth_provider %>
60     <div class="d-flex justify-content-center align-items-center">
61       <div class="border-bottom border-1 flex-grow-1"></div>
62       <div class="text-secondary mx-3"><%= t ".with external" %></div>
63       <div class="border-bottom border-1 flex-grow-1"></div>
64     </div>
65     <%= render :partial => "auth_providers" %>
66   <% end %>
67 </div>