|
6 | 6 | =< t('devise.registrations.edit.title', resource: User.model_name.human) |
7 | 7 |
|
8 | 8 | .row.my-4 |
9 | | - = form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put}) do |f| |
| 9 | + = form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put}, id: 'edit_user') do |f| |
10 | 10 | = render('shared/form_errors', object: resource, title: t('common.errors.changes_not_saved')) |
11 | 11 |
|
12 | 12 | .form-group.field-element |
|
74 | 74 | small.form-text.text-body-secondary = t('devise.registrations.edit.we_need_your_current_password_to_confirm_your_changes') |
75 | 75 |
|
76 | 76 |
|
77 | | - - if devise_mapping.omniauthable? && resource_class.omniauth_providers.any? |
78 | | - .form-group.field-element |
79 | | - .form-label |
80 | | - = t('.manage_omniauth') |
81 | | - .form-content.manage_omniauth |
82 | | - - resource_class.omniauth_providers.each do |provider| |
83 | | - - provider_name = OmniAuth::Utils.camelize(provider) |
84 | | - - configured_providers = current_user.omniauth_identities.pluck(:omniauth_provider) |
85 | | - - if configured_providers.include?(provider.to_s) && (configured_providers.size > 1 || resource.password_set?) |
86 | | - = button_to(t('.remove_identity', kind: provider_name), omniauth_deauthorize_path(provider), class: 'btn btn-light btn-sm mb-2 me-2', method: :delete) |
87 | | - - elsif configured_providers.include?(provider.to_s) |
88 | | - a.btn.btn-light.btn-sm.mb-2.me-2.disabled href='#' |
89 | | - = t('.cannot_remove_last_identity', kind: provider_name) |
90 | | - - else |
91 | | - = button_to(t('.add_identity', kind: provider_name), omniauth_authorize_path(resource_name, provider), class: 'btn btn-light btn-sm mb-2 me-2', method: :post) |
| 77 | + - if devise_mapping.omniauthable? && resource_class.omniauth_providers.any? |
| 78 | + .form-group.field-element.px-4 |
| 79 | + .form-label |
| 80 | + = t('.manage_omniauth') |
| 81 | + .form-content.manage_omniauth |
| 82 | + - resource_class.omniauth_providers.each do |provider| |
| 83 | + - provider_name = OmniAuth::Utils.camelize(provider) |
| 84 | + - configured_providers = current_user.omniauth_identities.pluck(:omniauth_provider) |
| 85 | + - if configured_providers.include?(provider.to_s) && (configured_providers.size > 1 || resource.password_set?) |
| 86 | + = button_to(t('.remove_identity', kind: provider_name), omniauth_deauthorize_path(provider), class: 'btn btn-light btn-sm mb-2 me-2', method: :delete) |
| 87 | + - elsif configured_providers.include?(provider.to_s) |
| 88 | + a.btn.btn-light.btn-sm.mb-2.me-2.disabled href='#' |
| 89 | + = t('.cannot_remove_last_identity', kind: provider_name) |
| 90 | + - else |
| 91 | + = button_to(t('.add_identity', kind: provider_name), omniauth_authorize_path(resource_name, provider), class: 'btn btn-light btn-sm mb-2 me-2', method: :post) |
92 | 92 |
|
93 | | - .form-group.py-3 |
94 | | - .btn-group role='group' |
95 | | - = button_tag type: 'submit', class: 'btn btn-important' do |
96 | | - i.fa-solid.fa-user |
97 | | - =< t('common.button.update') |
98 | | - = link_to(:back, class: 'btn btn-important') do |
99 | | - i.fa-solid.fa-xmark.text-secondary |
100 | | - =< t('common.button.back') |
| 93 | + .form-group.py-3 |
| 94 | + .btn-group role='group' |
| 95 | + = button_tag type: 'submit', class: 'btn btn-important', form: 'edit_user' do |
| 96 | + i.fa-solid.fa-user |
| 97 | + =< t('common.button.update') |
| 98 | + = link_to(:back, class: 'btn btn-important') do |
| 99 | + i.fa-solid.fa-xmark.text-secondary |
| 100 | + =< t('common.button.back') |
0 commit comments