|
7 | 7 | ' Public Profile |
8 | 8 | .panel-body |
9 | 9 | = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'profile' }) do |f| |
10 | | - .form-group |
| 10 | + - if current_user.email.empty? |
| 11 | + p |
| 12 | + | Your profile is not complete. Please, submit an email to be used in this Portus instance. |
| 13 | + .form-group class=(current_user.email.empty? ? "has-error" : "") |
11 | 14 | .field |
12 | | - = f.label :email |
13 | | - = f.text_field(:email, class: 'form-control', required: true) |
| 15 | + - if current_user.email.empty? |
| 16 | + = f.label :email, "Email", class: "control-label", title: "This profile is not complete. You need to provide an email first" |
| 17 | + - else |
| 18 | + = f.label :email |
| 19 | + = f.text_field(:email, class: 'form-control', required: true, autofocus: true) |
14 | 20 | .form-group |
15 | 21 | .actions |
16 | 22 | = f.submit('Update', class: 'btn btn-primary', disabled: true) |
17 | 23 |
|
18 | | - .panel.panel-default |
19 | | - .panel-heading |
20 | | - h5 |
21 | | - ' Change Password |
22 | | - .panel-body |
23 | | - = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'password' }) do |f| |
24 | | - - if devise_mapping.confirmable? && resource.pending_reconfirmation? |
25 | | - div |
26 | | - Currently waiting confirmation for: #{resource.unconfirmed_email} |
27 | | - .form-group |
28 | | - .field |
29 | | - = f.label :current_password, class: 'control-label' |
30 | | - = f.password_field :current_password, autocomplete: 'off', class: 'form-control' |
31 | | - br |
32 | | - .field |
33 | | - = f.label :password, class: 'control-label' |
34 | | - = f.password_field :password, autocomplete: 'off', class: 'form-control' |
35 | | - br |
36 | | - .field |
37 | | - = f.label :password_confirmation, class: 'control-label' |
38 | | - = f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' |
39 | | - .form-group |
40 | | - .actions |
41 | | - = f.submit('Change', class: 'btn btn-primary', disabled: true) |
42 | | - |
43 | | - - unless current_user.admin? && @admin_count == 1 |
| 24 | + - unless current_user.email.empty? |
44 | 25 | .panel.panel-default |
45 | 26 | .panel-heading |
46 | 27 | h5 |
47 | | - ' Disable account |
| 28 | + ' Change Password |
48 | 29 | .panel-body |
49 | | - = form_tag(toggle_enabled_path(current_user), method: :put, remote: true, id: 'disable-form') do |
50 | | - .form-group |
51 | | - p |
52 | | - | By disabling the account, you won't be able to access Portus with it, and |
53 | | - any affiliations with any team will be lost. |
54 | | - = submit_tag('Disable', class: 'btn btn-primary btn-danger') |
| 30 | + = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'password' }) do |f| |
| 31 | + - if devise_mapping.confirmable? && resource.pending_reconfirmation? |
| 32 | + div |
| 33 | + Currently waiting confirmation for: #{resource.unconfirmed_email} |
| 34 | + .form-group |
| 35 | + .field |
| 36 | + = f.label :current_password, class: 'control-label' |
| 37 | + = f.password_field :current_password, autocomplete: 'off', class: 'form-control' |
| 38 | + br |
| 39 | + .field |
| 40 | + = f.label :password, class: 'control-label' |
| 41 | + = f.password_field :password, autocomplete: 'off', class: 'form-control' |
| 42 | + br |
| 43 | + .field |
| 44 | + = f.label :password_confirmation, class: 'control-label' |
| 45 | + = f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' |
| 46 | + .form-group |
| 47 | + .actions |
| 48 | + = f.submit('Change', class: 'btn btn-primary', disabled: true) |
| 49 | + |
| 50 | + - unless current_user.admin? && @admin_count == 1 |
| 51 | + .panel.panel-default |
| 52 | + .panel-heading |
| 53 | + h5 |
| 54 | + ' Disable account |
| 55 | + .panel-body |
| 56 | + = form_tag(toggle_enabled_path(current_user), method: :put, remote: true, id: 'disable-form') do |
| 57 | + .form-group |
| 58 | + p |
| 59 | + | By disabling the account, you won't be able to access Portus with it, and |
| 60 | + any affiliations with any team will be lost. |
| 61 | + = submit_tag('Disable', class: 'btn btn-primary btn-danger') |
0 commit comments