]> git.openstreetmap.org Git - rails.git/blob - app/views/users/account.html.erb
233f2629fa96f1ca84174e4c873d8b17c36e376f
[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 <%= error_messages_for current_user %>
14 <%= form_for current_user, :url => { :action => :account }, :method => :post, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
15   <fieldset>
16     <div class="form-row">
17       <label class="standard-label"><%= t 'users.new.display name' %></label>
18       <%= f.text_field :display_name %>
19     </div>
20   </fieldset>
21
22   <fieldset>
23     <div class="form-row">
24       <label class="standard-label"><%= t '.current email address' %></label>
25       <input type="email" disabled value="<%= current_user.email %>" />
26       <span class="form-help deemphasize"><%= t '.email never displayed publicly' %></span>
27     </div>
28
29     <div class="form-row">
30       <label class="standard-label"><%= t '.new email address' %></label>
31       <%= f.email_field :new_email, :autocomplete => :off %>
32       <span class="form-help deemphasize"><%= t '.email never displayed publicly' %></span>
33     </div>
34   </fieldset>
35
36   <fieldset>
37     <div class="form-row">
38         <label class="standard-label"><%= t 'users.new.password' %></label>
39       <%= f.password_field :pass_crypt, {:value => '', :autocomplete => :off} %>
40     </div>
41
42     <div class="form-row">
43       <label class="standard-label"><%= t 'users.new.confirm password' %></label>
44       <%= f.password_field :pass_crypt_confirmation, {:value => '', :autocomplete => :off} %>
45     </div>
46   </fieldset>
47
48   <fieldset>
49     <div class="form-row">
50       <label class="standard-label"><%= t '.external auth' %></label>
51       <%= f.select :auth_provider, Auth::PROVIDERS %>
52       <%= f.text_field :auth_uid %>
53       <span class="form-help deemphasize">(<a href="<%= t '.openid.link' %>" target="_new"><%= t '.openid.link text' %></a>)</span>
54     </diV>
55   </fieldset>
56
57   <fieldset class="form-divider">
58     <div class="form-row">
59       <label class="standard-label"><%= t '.public editing.heading' %></label>
60       <span class="form-help deemphasize">
61         <% if current_user.data_public? %>
62           <%= t '.public editing.enabled' %>
63           (<a href="<%= t '.public editing.enabled link' %>" target="_new"><%= t '.public editing.enabled link text' %></a>)
64         <% else %>
65           <%= t '.public editing.disabled' %>
66           (<a href="#public"><%= t '.public editing.disabled link text' %></a>)
67         <% end %>
68       </span>
69     </div>
70
71     <div class="form-row">
72       <label class="standard-label"><%= t '.contributor terms.heading' %></label>
73       <span class="form-help deemphasize">
74         <% if current_user.terms_agreed? %>
75           <%= t '.contributor terms.agreed' %>
76           (<a href="<%= t '.contributor terms.link' %>" target="_new"><%= t '.contributor terms.link text' %></a>)
77           <% if current_user.consider_pd? %>
78             <%= t '.contributor terms.agreed_with_pd' %>
79           <% end %>
80         <% else %>
81           <%= t '.contributor terms.not yet agreed' %>
82           <%= link_to t('.contributor terms.review link text'), :controller => 'users', :action => 'terms' %>
83         <% end %>
84       </span>
85     </div>
86     <div class="form-row">
87       <label class="standard-label"><%= t '.preferred editor' %></label>
88       <%= f.select :preferred_editor, [[t("editor.default", :name => t("editor.#{Settings.default_editor}.name")), 'default']] + Editors::ALL_EDITORS.collect { |e| [t("editor.#{e}.description"), e] } %>
89     </div>
90   </fieldset>
91
92   <fieldset class="form-divider">
93     <div class='form-row'>
94       <label class="standard-label"><%= t '.profile description' %></label>
95       <%= richtext_area :user, :description, :object => current_user, :cols => 80, :rows => 20 %>
96     </div>
97
98     <div class="form-row">
99       <label class="standard-label"><%= t '.preferred languages' %></label>
100       <%= f.text_field :languages %>
101     </div>
102
103     <div class='form-row accountImage'>
104       <label class="standard-label"><%= t '.image' %></label>
105         <%= user_image current_user %>
106         <ul class='form-list accountImage-options'>
107         <% if current_user.image.file? %>
108         <li>
109           <%= radio_button_tag "image_action", "keep", !current_user.image_use_gravatar %>
110           <label class='standard-label' for='image_action_keep'><%= t '.keep image' %></label>
111         </li>
112         <% end %>
113         <% if current_user.image.file? || current_user.image_use_gravatar? %>
114         <li>
115           <%= radio_button_tag "image_action", "delete" %>
116           <label class='standard-label' for='image_action_delete'><%= t '.delete image' %></label>
117         </li>
118         <% end %>
119         <% if current_user.image.file? %>
120           <li>
121             <%= radio_button_tag "image_action", "new" %>
122             <label class='standard-label' for='image_action_new'>
123                 <%= t '.replace image' %>
124                 <span class="form-help deemphasize"><%= t '.image size hint' %></span>
125             </label>
126             <%= f.file_field :image %>
127           </li>
128         <% else %>
129         <li>
130           <%= radio_button_tag "image_action", "new" %>
131           <label class='standard-label' for='image_action_new'>
132             <%= t '.new image' %>
133             <span class="form-help deemphasize"><%= t '.image size hint' %></span>
134           </label>
135           <%= f.file_field :image %>
136         </li>
137         <% end %>
138         <li>
139           <%= radio_button_tag "image_action", "gravatar", current_user.image_use_gravatar %>
140           <label class='standard-label' for='image_action_gravatar'>
141             <%= t '.gravatar.gravatar' %>
142             <span class='form-help deemphasize'> (<a href="<%= t '.gravatar.link' %>" target="_new"><%= t '.gravatar.link text' %></a>)</span>
143           </label>
144         </li>
145       </ul>
146     </div>
147   </fieldset>
148
149   <fieldset class="form-divider">
150     <div class='form-row location clearfix'>
151     <label class="standard-label"><%= t '.home location' %></label>
152     <div id="homerow" <% unless current_user.home_lat and current_user.home_lon %>class="nohome"<%end%> >
153       <p class="message form-help deemphasize"><%= t '.no home location' %></p>
154         <div class='form-column'>
155           <label class="standard-label secondary"><%= t '.latitude' %></label>
156           <%= f.text_field :home_lat, :id => "home_lat" %>
157         </div>
158         <div class='form-column'>
159           <label class="standard-label secondary"><%= t '.longitude' %></label>
160           <%= f.text_field :home_lon, :id => "home_lon" %>
161         </div>
162       </div>
163     </div>
164
165     <div class="form-row">
166       <input type="checkbox" name="updatehome" value="1" <% unless current_user.home_lat and current_user.home_lon %> checked="checked" <% end %> id="updatehome" />
167       <label class="standard-label" for="updatehome"><%= t '.update home location on click' %></label>
168     </div>
169     <%= content_tag "div", "", :id => "map", :class => "content_map settings_map set_location" %>
170   </fieldset>
171
172   <%= submit_tag t('.save changes button') %>
173 <% end %>
174
175 <% unless current_user.data_public? %>
176 <a name="public"></a>
177 <h2><%= t '.public editing note.heading' %></h2>
178 <%= raw t '.public editing note.text' %>
179   <%= button_to t('.make edits public button'), :action => :go_public %>
180 <% end %>