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