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