/
edit.html.haml
45 lines (45 loc) · 1.81 KB
/
edit.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.row
.col-md-6.col-md-offset-3
%h2
Edit your profile
%hr
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put, :multipart => true }) do |f|
= devise_error_messages!
%div.form-group
= f.label :email
= f.email_field :email, :autofocus => true, :class => "form-control"
- if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div
Currently waiting confirmation for: #{resource.unconfirmed_email}
%div.form-group
= f.label :username
= f.text_field :username, :class => "form-control"
%div.form-group.well
.row
.col-md-3
= image_tag current_user.avatar.url(:thumb)
.col-md-9
= f.label :avatar
= f.file_field :avatar
%hr
%h4 Change password
%div.well
%div.form-group
= f.label :password
%i (leave blank if you don't want to change it)
= f.password_field :password, :autocomplete => "off", :class => "form-control"
%div.form-group
= f.label :password_confirmation
= f.password_field :password_confirmation, :class => "form-control"
%hr
%div.form-group.well
= f.label :current_password
%i (we need your current password to confirm your changes)
= f.password_field :current_password, :class => "form-control"
%div.form-group
= f.submit "Update", :class => "btn btn-primary"
%a{:href => user_profile_path(current_user.username), :class => 'btn btn-default'} View Profile
%hr
%h3 Cancel my account
%p
Unhappy? #{button_to "Cancel my account", registration_path(resource_name), :class => "btn btn-danger", :data => { :confirm => "Are you sure?" }, :method => :delete}