]> git.openstreetmap.org Git - rails.git/blob - app/views/users/new.html.erb
Add tabbed navigation for signup/login screens
[rails.git] / app / views / users / new.html.erb
1 <% content_for :head do %>
2   <%= javascript_include_tag "user" %>
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   <div class="header-illustration new-user-main auth-container mx-auto">
10     <ul class="nav nav-tabs position-absolute bottom-0 px-3 fs-6 w-100">
11       <li class="nav-item">
12         <%= link_to t("sessions.new.tab_title"), url_for(:action => :new, :controller => :sessions), :class => "nav-link" %>
13       </li>
14       <li class="nav-item">
15         <%= link_to t("users.new.tab_title"), "#", :class => "nav-link active" %>
16       </li>
17     </ul>
18   </div>
19 <% end %>
20
21 <div class="auth-container mx-auto my-0">
22   <% if current_user.auth_uid.nil? %>
23     <div class="text-muted fs-6">
24       <p><strong><%= t ".about.header" %></strong> <%= t ".about.paragraph_1" %></p>
25       <p><%= t ".about.paragraph_2" %></p>
26     </div>
27   <% else %>
28     <h4><%= t ".about.welcome" %></h4>
29   <% end %>
30
31   <%= bootstrap_form_for current_user, :url => { :action => "create" } do |f| %>
32     <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %>
33     <%= hidden_field_tag("verified_email", h(@verified_email)) unless @verified_email.nil? %>
34     <%= f.hidden_field :auth_provider unless current_user.auth_provider.nil? %>
35     <%= f.hidden_field :auth_uid unless current_user.auth_uid.nil? %>
36
37     <% if current_user.auth_uid.nil? or not current_user.errors[:email].empty? %>
38       <%= f.email_field :email, :help => t(".email_help_html",
39                                            :privacy_policy_link => link_to(t(".privacy_policy"),
40                                                                            t(".privacy_policy_url"),
41                                                                            :title => t(".privacy_policy_title"),
42                                                                            :target => :new)),
43                                 :tabindex => 1 %>
44     <% else %>
45       <%= f.hidden_field :email %>
46     <% end %>
47
48     <%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 2 %>
49
50     <% if current_user.auth_uid.nil? %>
51       <div class="row">
52         <div class="col-sm">
53           <%= f.password_field :pass_crypt, :tabindex => 3 %>
54         </div>
55         <div class="col-sm">
56           <%= f.password_field :pass_crypt_confirmation, :tabindex => 4 %>
57         </div>
58       </div>
59     <% end %>
60
61     <p class="mb-3 text-muted"><%= t(".by_signing_up_html",
62                                      :tou_link => link_to(t("layouts.tou"),
63                                                           "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
64                                                           :target => :new),
65                                      :privacy_policy_link => link_to(t(".privacy_policy"),
66                                                                      t(".privacy_policy_url"),
67                                                                      :title => t(".privacy_policy_title"),
68                                                                      :target => :new),
69                                      :contributor_terms_link => link_to(t(".contributor_terms"),
70                                                                         t(".contributor_terms_url"),
71                                                                         :target => :new)) %></p>
72
73     <%= f.form_group do %>
74       <%= f.check_box :consider_pd,
75                       :tabindex => 5,
76                       :label => t(".consider_pd_html",
77                                   :consider_pd_link => link_to(t(".consider_pd"),
78                                                                t(".consider_pd_url"),
79                                                                :target => :new)) %>
80     <% end %>
81
82     <div class="mb-3">
83       <%= submit_tag(t(".continue"), :name => "continue", :id => "continue", :class => "btn btn-primary", :tabindex => 6) %>
84     </div>
85   <% end %>
86
87   <% if current_user.auth_uid.nil? %>
88     <hr>
89     <%= render :partial => "auth_providers" %>
90   <% end %>
91 </div>