1
0

edit.html.erb 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <% content_for :title, "Account" -%>
  2. <div class='container'>
  3. <div class='row'>
  4. <div class='col-md-8 col-md-offset-2'>
  5. <div class='well'>
  6. <h2>Edit <%= resource_name.to_s.humanize %></h2>
  7. <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-horizontal' }) do |f| %>
  8. <%= devise_error_messages! %>
  9. <div class="form-group">
  10. <%= f.label :email, class: 'col-md-4 control-label' %>
  11. <div class="col-md-6">
  12. <%= f.email_field :email, autofocus: true, class: 'form-control' %>
  13. </div>
  14. </div>
  15. <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
  16. <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
  17. <% end %>
  18. <div class="form-group">
  19. <%= f.label :username, class: 'col-md-4 control-label' %>
  20. <div class="col-md-6">
  21. <%= f.text_field :username, class: 'form-control' %>
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <%= f.label :current_password, class: 'col-md-4 control-label' %>
  26. <div class="col-md-6">
  27. <%= f.password_field :current_password, class: 'form-control' %>
  28. <span class='help-inline'>We need your current password to confirm your changes.</span>
  29. </div>
  30. </div>
  31. <div class="form-group">
  32. <div class="col-md-offset-4 col-md-10">
  33. <%= f.submit "Update", class: "btn btn-primary" %>
  34. </div>
  35. </div>
  36. <% end %>
  37. <h3>Change password</h3>
  38. <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-horizontal' }) do |f| %>
  39. <%= devise_error_messages! %>
  40. <div class="form-group">
  41. <%= f.label :current_password, class: 'col-md-4 control-label' %>
  42. <div class="col-md-6">
  43. <%= f.password_field :current_password, class: 'form-control' %>
  44. <span class='help-inline'>We need your current password to confirm your changes.</span>
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <%= f.label :password, class: 'col-md-4 control-label' %>
  49. <div class="col-md-6">
  50. <%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
  51. </div>
  52. </div>
  53. <div class="form-group">
  54. <%= f.label :password_confirmation, class: 'col-md-4 control-label' %>
  55. <div class="col-md-6">
  56. <%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
  57. </div>
  58. </div>
  59. <div class="form-group">
  60. <div class="col-md-offset-4 col-md-10">
  61. <%= f.submit "Update", class: "btn btn-primary" %>
  62. </div>
  63. </div>
  64. <% end %>
  65. <hr>
  66. <h3>Cancel my account</h3>
  67. <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
  68. <%= link_to "Back", :back %>
  69. </div>
  70. </div>
  71. </div>
  72. </div>