]> git.openstreetmap.org Git - rails.git/blob - app/views/users/new.html.erb
Set both light and dark banner themes
[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   <% if @client_app_name %>
10     <p class="text-center text-muted fs-6 py-2 mb-0 bg-white"><%= t(".signup_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"), url_for(:action => :new, :controller => :sessions), :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 <div class="auth-container mx-auto my-0">
26   <% if current_user.auth_uid.nil? %>
27     <div class="text-muted fs-6">
28       <p><strong><%= t ".about.header" %></strong> <%= t ".about.paragraph_1" %></p>
29       <p><%= t ".about.paragraph_2" %></p>
30     </div>
31
32     <% unless @preferred_auth_provider.nil? %>
33       <%= render :partial => "auth_providers" %>
34       <div class="d-flex justify-content-center align-items-center">
35         <div class="border-bottom border-1 flex-grow-1"></div>
36         <div class="text-secondary mx-3"><%= t ".or" %></div>
37         <div class="border-bottom border-1 flex-grow-1"></div>
38       </div>
39     <% end %>
40   <% else %>
41     <h4><%= t ".about.welcome" %></h4>
42   <% end %>
43
44   <%= bootstrap_form_for current_user, :url => { :action => "create" } do |f| %>
45     <%= hidden_field_tag("referer", h(@referer)) unless @referer.nil? %>
46     <%= hidden_field_tag("email_hmac", h(@email_hmac)) unless @email_hmac.nil? %>
47     <%= f.hidden_field :auth_provider unless current_user.auth_provider.nil? %>
48     <%= f.hidden_field :auth_uid unless current_user.auth_uid.nil? %>
49
50     <% if current_user.auth_uid.nil? or @email_hmac.nil? or not current_user.errors[:email].empty? %>
51       <%= f.email_field :email, :help => t(".email_help_html",
52                                            :privacy_policy_link => link_to(t(".privacy_policy"),
53                                                                            t(".privacy_policy_url"),
54                                                                            :title => t(".privacy_policy_title"),
55                                                                            :target => :new)),
56                                 :tabindex => 1 %>
57     <% else %>
58       <%= f.hidden_field :email %>
59     <% end %>
60
61     <%= f.text_field :display_name, :help => t(".display name description"), :tabindex => 2 %>
62
63     <% if current_user.auth_uid.nil? %>
64       <div class="row">
65         <div class="col-sm">
66           <%= f.password_field :pass_crypt, :tabindex => 3 %>
67         </div>
68         <div class="col-sm">
69           <%= f.password_field :pass_crypt_confirmation, :tabindex => 4 %>
70         </div>
71       </div>
72     <% end %>
73
74     <p class="mb-3 text-muted fs-6"><%= t(".by_signing_up_html",
75                                           :tou_link => link_to(t("layouts.tou"),
76                                                                "https://wiki.osmfoundation.org/wiki/Terms_of_Use",
77                                                                :target => :new),
78                                           :privacy_policy_link => link_to(t(".privacy_policy"),
79                                                                           t(".privacy_policy_url"),
80                                                                           :title => t(".privacy_policy_title"),
81                                                                           :target => :new),
82                                           :contributor_terms_link => link_to(t(".contributor_terms"),
83                                                                              t(".contributor_terms_url"),
84                                                                              :target => :new)) %></p>
85     <%= f.form_group do %>
86       <%= f.check_box :consider_pd,
87                       :tabindex => 5,
88                       :label => t(".consider_pd_html",
89                                   :consider_pd_link => link_to(t(".consider_pd"),
90                                                                t(".consider_pd_url"),
91                                                                :target => :new)) %>
92     <% end %>
93
94     <div class="mb-3">
95       <%= submit_tag(t(".continue"), :name => "continue", :id => "continue", :class => "btn btn-primary", :tabindex => 6) %>
96     </div>
97   <% end %>
98
99   <% if current_user.auth_uid.nil? and @preferred_auth_provider.nil? %>
100     <div class="d-flex justify-content-center align-items-center">
101       <div class="border-bottom border-1 flex-grow-1"></div>
102       <div class="text-secondary mx-3"><%= t ".use external auth" %></div>
103       <div class="border-bottom border-1 flex-grow-1"></div>
104     </div>
105     <%= render :partial => "auth_providers" %>
106   <% end %>
107 </div>