You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

account.html.erb 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <div class="contextual">
  2. <%= additional_emails_link(@user) %>
  3. <%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
  4. <%= call_hook(:view_my_account_contextual, :user => @user)%>
  5. </div>
  6. <h2>
  7. <%= avatar_edit_link(@user, :size => "50") %>
  8. <%=l(:label_my_account)%>
  9. </h2>
  10. <%= error_messages_for 'user' %>
  11. <%= labelled_form_for :user, @user,
  12. :url => { :action => "account" },
  13. :html => { :id => 'my_account_form',
  14. :method => :put, :multipart => true } do |f| %>
  15. <div class="splitcontent">
  16. <div class="splitcontentleft">
  17. <fieldset class="box tabular">
  18. <legend><%=l(:label_information_plural)%></legend>
  19. <p><%= f.text_field :firstname, :required => true %></p>
  20. <p><%= f.text_field :lastname, :required => true %></p>
  21. <p><%= f.text_field :mail, :required => true %></p>
  22. <% unless @user.force_default_language? %>
  23. <p><%= f.select :language, lang_options_for_select %></p>
  24. <% end %>
  25. <% if Setting.twofa? -%>
  26. <p>
  27. <label><%=l :setting_twofa -%></label>
  28. <% if @user.twofa_active? %>
  29. <%=l 'twofa_currently_active', twofa_scheme_name: l("twofa__#{@user.twofa_scheme}__name") -%><br/>
  30. <%= link_to l('button_disable'), { controller: 'twofa', action: 'deactivate_init', scheme: @user.twofa_scheme }, method: :post -%><br/>
  31. <%= link_to l('twofa_generate_backup_codes'), { controller: 'twofa_backup_codes', action: 'init' }, method: :post, data: { confirm: Redmine::Twofa.for_user(User.current).backup_codes.any? ? t('twofa_text_generate_backup_codes_confirmation') : nil } -%>
  32. <% else %>
  33. <% Redmine::Twofa.available_schemes.each do |s| %>
  34. <%= link_to l("twofa__#{s}__label_activate"), { controller: 'twofa', action: 'activate_init', scheme: s }, method: :post -%><br/>
  35. <% end %>
  36. <% end %>
  37. </p>
  38. <% end -%>
  39. <% @user.custom_field_values.select(&:editable?).each do |value| %>
  40. <p><%= custom_field_tag_with_label :user, value %></p>
  41. <% end %>
  42. <%= call_hook(:view_my_account, :user => @user, :form => f) %>
  43. </fieldset>
  44. <p class="mobile-hide"><%= submit_tag l(:button_save) %></p>
  45. </div>
  46. <div class="splitcontentright">
  47. <fieldset class="box">
  48. <legend><%=l(:field_mail_notification)%></legend>
  49. <%= render :partial => 'users/mail_notifications' %>
  50. </fieldset>
  51. <fieldset class="box tabular">
  52. <legend><%=l(:label_preferences)%></legend>
  53. <%= render :partial => 'users/preferences' %>
  54. <%= call_hook(:view_my_account_preferences, :user => @user, :form => f) %>
  55. </fieldset>
  56. <p class="mobile-show"><%= submit_tag l(:button_save) %></p>
  57. </div>
  58. </div>
  59. <% end %>
  60. <% content_for :sidebar do %>
  61. <%= render :partial => 'sidebar' %>
  62. <% end %>
  63. <% html_title(l(:label_my_account)) -%>