Chris@0
|
1 <div class="contextual">
|
Chris@0
|
2 <%= link_to(l(:button_change_password), :action => 'password') if @user.change_password_allowed? %>
|
Chris@0
|
3 <%= call_hook(:view_my_account_contextual, :user => @user)%>
|
Chris@0
|
4 </div>
|
Chris@0
|
5 <h2><%=l(:label_my_account)%></h2>
|
Chris@0
|
6 <%= error_messages_for 'user' %>
|
Chris@0
|
7
|
Chris@0
|
8 <% form_for :user, @user, :url => { :action => "account" },
|
Chris@0
|
9 :builder => TabularFormBuilder,
|
Chris@0
|
10 :lang => current_language,
|
Chris@0
|
11 :html => { :id => 'my_account_form' } do |f| %>
|
Chris@0
|
12 <div class="splitcontentleft">
|
Chris@0
|
13 <h3><%=l(:label_information_plural)%></h3>
|
Chris@0
|
14 <div class="box tabular">
|
Chris@0
|
15 <p><%= f.text_field :firstname, :required => true %></p>
|
Chris@0
|
16 <p><%= f.text_field :lastname, :required => true %></p>
|
Chris@0
|
17 <p><%= f.text_field :mail, :required => true %></p>
|
Chris@0
|
18 <p><%= f.select :language, lang_options_for_select %></p>
|
Chris@0
|
19 <% if Setting.openid? %>
|
Chris@0
|
20 <p><%= f.text_field :identity_url %></p>
|
Chris@0
|
21 <% end %>
|
Chris@0
|
22
|
Chris@0
|
23 <% @user.custom_field_values.select(&:editable?).each do |value| %>
|
Chris@0
|
24 <p><%= custom_field_tag_with_label :user, value %></p>
|
Chris@0
|
25 <% end %>
|
Chris@0
|
26 <%= call_hook(:view_my_account, :user => @user, :form => f) %>
|
Chris@0
|
27 </div>
|
Chris@0
|
28
|
Chris@0
|
29 <%= submit_tag l(:button_save) %>
|
Chris@0
|
30 </div>
|
Chris@0
|
31
|
Chris@0
|
32 <div class="splitcontentright">
|
Chris@0
|
33 <h3><%=l(:field_mail_notification)%></h3>
|
Chris@0
|
34 <div class="box">
|
Chris@0
|
35 <%= select_tag 'notification_option', options_for_select(@notification_options, @notification_option),
|
Chris@0
|
36 :onchange => 'if ($("notification_option").value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %>
|
Chris@0
|
37 <% content_tag 'div', :id => 'notified-projects', :style => (@notification_option == 'selected' ? '' : 'display:none;') do %>
|
Chris@0
|
38 <p><% User.current.projects.each do |project| %>
|
Chris@0
|
39 <label><%= check_box_tag 'notified_project_ids[]', project.id, @user.notified_projects_ids.include?(project.id) %> <%=h project.name %></label><br />
|
Chris@0
|
40 <% end %></p>
|
Chris@0
|
41 <p><em><%= l(:text_user_mail_option) %></em></p>
|
Chris@0
|
42 <% end %>
|
Chris@0
|
43 <p><label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %> <%= l(:label_user_mail_no_self_notified) %></label></p>
|
Chris@0
|
44 </div>
|
Chris@0
|
45
|
Chris@0
|
46 <h3><%=l(:label_preferences)%></h3>
|
Chris@0
|
47 <div class="box tabular">
|
Chris@0
|
48 <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %>
|
Chris@0
|
49 <p><%= pref_fields.check_box :hide_mail %></p>
|
Chris@0
|
50 <p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
|
Chris@0
|
51 <p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p>
|
Chris@0
|
52 <% end %>
|
Chris@0
|
53 </div>
|
Chris@0
|
54
|
Chris@0
|
55 </div>
|
Chris@0
|
56 <% end %>
|
Chris@0
|
57
|
Chris@0
|
58 <% content_for :sidebar do %>
|
Chris@0
|
59 <%= render :partial => 'sidebar' %>
|
Chris@0
|
60 <% end %>
|
Chris@0
|
61
|
Chris@0
|
62 <% html_title(l(:label_my_account)) -%>
|