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