@@ -1,51 +1,52 | |||
|
1 | 1 | <div class="contextual"> |
|
2 | 2 | <%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %> |
|
3 | 3 | <%= call_hook(:view_my_account_contextual, :user => @user)%> |
|
4 | 4 | </div> |
|
5 | 5 | |
|
6 | 6 | <h2><%=l(:label_my_account)%></h2> |
|
7 | 7 | <%= error_messages_for 'user' %> |
|
8 | 8 | |
|
9 | 9 | <%= labelled_form_for :user, @user, |
|
10 | 10 | :url => { :action => "account" }, |
|
11 | 11 | :html => { :id => 'my_account_form', |
|
12 | 12 | :method => :post } do |f| %> |
|
13 | 13 | <div class="splitcontentleft"> |
|
14 | 14 | <fieldset class="box tabular"> |
|
15 | 15 | <legend><%=l(:label_information_plural)%></legend> |
|
16 | 16 | <p><%= f.text_field :firstname, :required => true %></p> |
|
17 | 17 | <p><%= f.text_field :lastname, :required => true %></p> |
|
18 | 18 | <p><%= f.text_field :mail, :required => true %></p> |
|
19 | 19 | <p><%= f.select :language, lang_options_for_select %></p> |
|
20 | 20 | <% if Setting.openid? %> |
|
21 | 21 | <p><%= f.text_field :identity_url %></p> |
|
22 | 22 | <% end %> |
|
23 | 23 | |
|
24 | 24 | <% @user.custom_field_values.select(&:editable?).each do |value| %> |
|
25 | 25 | <p><%= custom_field_tag_with_label :user, value %></p> |
|
26 | 26 | <% end %> |
|
27 | 27 | <%= call_hook(:view_my_account, :user => @user, :form => f) %> |
|
28 | 28 | </fieldset> |
|
29 | 29 | |
|
30 | 30 | <%= submit_tag l(:button_save) %> |
|
31 | 31 | </div> |
|
32 | 32 | |
|
33 | 33 | <div class="splitcontentright"> |
|
34 | 34 | <fieldset class="box"> |
|
35 | 35 | <legend><%=l(:field_mail_notification)%></legend> |
|
36 | 36 | <%= render :partial => 'users/mail_notifications' %> |
|
37 | 37 | </fieldset> |
|
38 | 38 | |
|
39 | 39 | <fieldset class="box tabular"> |
|
40 | 40 | <legend><%=l(:label_preferences)%></legend> |
|
41 | 41 | <%= render :partial => 'users/preferences' %> |
|
42 | <%= call_hook(:view_my_account_preferences, :user => @user, :form => f) %> | |
|
42 | 43 | </fieldset> |
|
43 | 44 | |
|
44 | 45 | </div> |
|
45 | 46 | <% end %> |
|
46 | 47 | |
|
47 | 48 | <% content_for :sidebar do %> |
|
48 | 49 | <%= render :partial => 'sidebar' %> |
|
49 | 50 | <% end %> |
|
50 | 51 | |
|
51 | 52 | <% html_title(l(:label_my_account)) -%> |
@@ -1,66 +1,67 | |||
|
1 | 1 | <%= error_messages_for 'user' %> |
|
2 | 2 | |
|
3 | 3 | <div id="user_form"> |
|
4 | 4 | <!--[form:user]--> |
|
5 | 5 | <div class="splitcontentleft"> |
|
6 | 6 | <fieldset class="box tabular"> |
|
7 | 7 | <legend><%=l(:label_information_plural)%></legend> |
|
8 | 8 | <p><%= f.text_field :login, :required => true, :size => 25 %></p> |
|
9 | 9 | <p><%= f.text_field :firstname, :required => true %></p> |
|
10 | 10 | <p><%= f.text_field :lastname, :required => true %></p> |
|
11 | 11 | <p><%= f.text_field :mail, :required => true %></p> |
|
12 | 12 | <p><%= f.select :language, lang_options_for_select %></p> |
|
13 | 13 | <% if Setting.openid? %> |
|
14 | 14 | <p><%= f.text_field :identity_url %></p> |
|
15 | 15 | <% end %> |
|
16 | 16 | |
|
17 | 17 | <% @user.custom_field_values.each do |value| %> |
|
18 | 18 | <p><%= custom_field_tag_with_label :user, value %></p> |
|
19 | 19 | <% end %> |
|
20 | 20 | |
|
21 | 21 | <p><%= f.check_box :admin, :disabled => (@user == User.current) %></p> |
|
22 | 22 | <%= call_hook(:view_users_form, :user => @user, :form => f) %> |
|
23 | 23 | </fieldset> |
|
24 | 24 | |
|
25 | 25 | <fieldset class="box tabular"> |
|
26 | 26 | <legend><%=l(:label_authentication)%></legend> |
|
27 | 27 | <% unless @auth_sources.empty? %> |
|
28 | 28 | <p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {$('#password_fields').show();} else {$('#password_fields').hide();}" %></p> |
|
29 | 29 | <% end %> |
|
30 | 30 | <div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>"> |
|
31 | 31 | <p><%= f.password_field :password, :required => true, :size => 25 %> |
|
32 | 32 | <em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> |
|
33 | 33 | <p><%= f.password_field :password_confirmation, :required => true, :size => 25 %></p> |
|
34 | 34 | <p><%= f.check_box :generate_password %></p> |
|
35 | 35 | <p><%= f.check_box :must_change_passwd %></p> |
|
36 | 36 | </div> |
|
37 | 37 | </fieldset> |
|
38 | 38 | </div> |
|
39 | 39 | |
|
40 | 40 | <div class="splitcontentright"> |
|
41 | 41 | <fieldset class="box"> |
|
42 | 42 | <legend><%=l(:field_mail_notification)%></legend> |
|
43 | 43 | <%= render :partial => 'users/mail_notifications' %> |
|
44 | 44 | </fieldset> |
|
45 | 45 | |
|
46 | 46 | <fieldset class="box tabular"> |
|
47 | 47 | <legend><%=l(:label_preferences)%></legend> |
|
48 | 48 | <%= render :partial => 'users/preferences' %> |
|
49 | <%= call_hook(:view_users_form_preferences, :user => @user, :form => f) %> | |
|
49 | 50 | </fieldset> |
|
50 | 51 | </div> |
|
51 | 52 | </div> |
|
52 | 53 | <div style="clear:left;"></div> |
|
53 | 54 | <!--[eoform:user]--> |
|
54 | 55 | |
|
55 | 56 | <%= javascript_tag do %> |
|
56 | 57 | $(document).ready(function(){ |
|
57 | 58 | $('#user_generate_password').change(function(){ |
|
58 | 59 | var passwd = $('#user_password, #user_password_confirmation'); |
|
59 | 60 | if ($(this).is(':checked')){ |
|
60 | 61 | passwd.val('').attr('disabled', true); |
|
61 | 62 | }else{ |
|
62 | 63 | passwd.removeAttr('disabled'); |
|
63 | 64 | } |
|
64 | 65 | }).trigger('change'); |
|
65 | 66 | }); |
|
66 | 67 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now