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