]> git.openstreetmap.org Git - rails.git/blob - app/views/users/account.html.erb
Merge remote-tracking branch 'upstream/pull/3120'
[rails.git] / app / views / users / account.html.erb
1 <% content_for :head do %>
2   <%= javascript_include_tag "user" %>
3 <% end %>
4
5 <% content_for :heading do %>
6   <h1><%= t ".my settings" %></h1>
7   <ul class='secondary-actions clearfix'>
8     <li><%= link_to t(".return to profile"), user_path(current_user) %></li>
9     <li><%= link_to t("users.show.oauth settings"), :controller => "oauth_clients", :action => "index" %></li>
10   </ul>
11 <% end %>
12
13 <%= bootstrap_form_for current_user, :url => { :action => :account }, :method => :post, :html => { :multipart => true, :id => "accountForm", :autocomplete => :off } do |f| %>
14
15   <%= f.text_field :display_name %>
16   <%= f.email_field :email, :disabled => true, :label => t(".current email address") %>
17   <%= f.email_field :new_email, :autocomplete => "email" %>
18   <%= f.password_field :pass_crypt, :value => "", :autocomplete => "new-password" %>
19   <%= f.password_field :pass_crypt_confirmation, :value => "", :autocomplete => "new-password" %>
20
21   <fieldset class="form-group">
22     <label for="user_auth_provider"><%= t(".external auth") %></label>
23     <div class="form-row">
24       <%= f.select(:auth_provider, Auth.providers, :hide_label => true, :wrapper => { :class => "col-auto mb-0" }) %>
25       <%= f.text_field(:auth_uid, :hide_label => true, :wrapper => { :class => "col mb-0" }) %>
26     </div>
27     <small class="form-text text-muted">(<a href="<%= t ".openid.link" %>" target="_new"><%= t ".openid.link text" %></a>)</small>
28   </fieldset>
29
30   <div class="form-group">
31     <label><%= t ".public editing.heading" %></label>
32     <span class="form-text text-muted">
33       <% if current_user.data_public? %>
34         <%= t ".public editing.enabled" %>
35         (<a href="<%= t ".public editing.enabled link" %>" target="_new"><%= t ".public editing.enabled link text" %></a>)
36       <% else %>
37         <%= t ".public editing.disabled" %>
38         (<a href="#public"><%= t ".public editing.disabled link text" %></a>)
39       <% end %>
40     </span>
41   </div>
42
43   <div class="form-group">
44     <label><%= t ".contributor terms.heading" %></label>
45     <span class="form-text text-muted">
46       <% if current_user.terms_agreed? %>
47         <%= t ".contributor terms.agreed" %>
48         (<a href="<%= t ".contributor terms.link" %>" target="_new"><%= t ".contributor terms.link text" %></a>)
49         <% if current_user.consider_pd? %>
50           <%= t ".contributor terms.agreed_with_pd" %>
51         <% end %>
52       <% else %>
53         <%= t ".contributor terms.not yet agreed" %>
54         <%= link_to t(".contributor terms.review link text"), :controller => "users", :action => "terms" %>
55       <% end %>
56     </span>
57   </div>
58
59   <%= f.select :preferred_editor, [[t("editor.default", :name => t("editor.#{Settings.default_editor}.name")), "default"]] + Editors::AVAILABLE_EDITORS.collect { |e| [t("editor.#{e}.description"), e] } %>
60   <%= f.richtext_field :description, :cols => 80, :rows => 20 %>
61   <%= f.text_field :languages %>
62
63   <fieldset class="form-group">
64     <%= f.label t(".image") %>
65     <div class="form-row">
66       <div class="col-sm-2">
67         <%= user_image current_user %>
68       </div>
69       <div class="col-sm-10">
70         <% if current_user.avatar.attached? %>
71           <%= f.radio_button "avatar_action", "keep", :name => "avatar_action", :label => t(".keep image"), :checked => !current_user.image_use_gravatar %>
72         <% end %>
73         <% if current_user.avatar.attached? || current_user.image_use_gravatar? %>
74           <%= f.radio_button "avatar_action", "delete", :name => "avatar_action", :label => t(".delete image"), :checked => false %>
75         <% end %>
76         <% if current_user.avatar.attached? %>
77           <%= f.form_group :help => t(".image size hint"), :class => "mb-0" do %>
78             <%= f.radio_button "avatar_action", "new", :name => "avatar_action", :label => t(".replace image"), :checked => false %>
79             <%= f.file_field :avatar, :hide_label => true, :wrapper => { :class => "mb-0" } %>
80           <% end %>
81         <% else %>
82           <%= f.form_group :help => t(".image size hint"), :class => "mb-0" do %>
83             <%= f.radio_button "avatar_action", "new", :name => "avatar_action", :label => t(".new image"), :checked => false %>
84             <%= f.file_field :avatar, :hide_label => true, :wrapper => { :class => "mb-0" } %>
85           <% end %>
86         <% end %>
87         <%= f.form_group :help => link_to(t(".gravatar.what_is_gravatar"), t(".gravatar.link")) do %>
88           <%= f.radio_button "avatar_action", "gravatar", :name => "avatar_action", :label => t(".gravatar.gravatar"), :checked => current_user.image_use_gravatar %>
89         <% end %>
90       </div>
91     </div>
92   </fieldset>
93
94   <fieldset>
95     <legend><%= t ".home location" -%></legend>
96     <div id="homerow" <% unless current_user.home_lat and current_user.home_lon %> class="nohome"<% end %>>
97       <p class="message text-muted"><%= t ".no home location" %></p>
98       <div class="form-row">
99         <%= f.text_field :home_lat, :wrapper_class => "col-sm-4", :id => "home_lat" %>
100         <%= f.text_field :home_lon, :wrapper_class => "col-sm-4", :id => "home_lon" %>
101       </div>
102     </div>
103     <div class="form-check">
104       <input class="form-check-input" type="checkbox" name="updatehome" value="1" <% unless current_user.home_lat and current_user.home_lon %> checked="checked" <% end %> id="updatehome" />
105       <label class="form-check-label" for="updatehome"><%= t ".update home location on click" %></label>
106     </div>
107     <%= tag.div "", :id => "map", :class => "content_map set_location" %>
108   </fieldset>
109
110   <%= f.primary t(".save changes button") %>
111 <% end %>
112
113 <% unless current_user.data_public? %>
114 <a name="public"></a>
115 <h2><%= t ".public editing note.heading" %></h2>
116 <%= t ".public editing note.html" %>
117   <%= button_to t(".make edits public button"), :action => :go_public %>
118 <% end %>