It is now possible to edit all of your moderation profile.

Refs #164
This commit is contained in:
echarp 2020-04-07 18:47:35 +02:00
parent d0d2b26ec1
commit 973f804f41
2 changed files with 37 additions and 21 deletions

View File

@ -38,7 +38,8 @@ class ApplicationController < ActionController::Base
end end
def configure_permitted_parameters def configure_permitted_parameters
update_attrs = %i[password password_confirmation current_password] attrs = %i[login email firstname lastname
devise_parameter_sanitizer.permit :account_update, keys: update_attrs password password_confirmation current_password]
devise_parameter_sanitizer.permit :account_update, keys: attrs
end end
end end

View File

@ -1,35 +1,50 @@
%h2= t('.title', resource: resource.model_name.human) %h2= t('.title', resource: resource.model_name.human)
= form_for(resource, as: resource_name, url: send("#{resource_name}_registration_path"), html: { method: :put }) do |f|
= render "devise/shared/error_messages", resource: resource = form_for resource, as: resource_name,
url: send("#{resource_name}_registration_path"),
html: { method: :put } do |f|
= render 'devise/shared/error_messages', resource: resource
.field
= f.label :login
= f.text_field :login, autofocus: true, autocomplete: 'login'
.field .field
= f.label :email = f.label :email
%br/ = f.email_field :email, autocomplete: 'email'
= f.email_field :email, autofocus: true, autocomplete: "email"
- if devise_mapping.confirmable? && resource.pending_reconfirmation? - if devise_mapping.confirmable? && resource.pending_reconfirmation?
%div= t('.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email) %div
= t('.currently_waiting_confirmation_for_email',
email: resource.unconfirmed_email)
.field
= f.label :firstname
= f.text_field :firstname
.field
= f.label :lastname
= f.text_field :lastname
.field .field
= f.label :password = f.label :password
= f.password_field :password, autocomplete: 'new-password',
placeholder: t('devise.shared.minimum_password_length',
count: @minimum_password_length)
%br/
%i %i
(#{t('.leave_blank_if_you_don_t_want_to_change_it')}) (#{t('.leave_blank_if_you_don_t_want_to_change_it')})
%br/
= f.password_field :password, autocomplete: "new-password"
- if @minimum_password_length
%br/
%em= t('devise.shared.minimum_password_length', count: @minimum_password_length)
.field .field
= f.label :password_confirmation = f.label :password_confirmation
%br/ = f.password_field :password_confirmation, autocomplete: 'new-password'
= f.password_field :password_confirmation, autocomplete: "new-password"
.field .field
= f.label :current_password = f.label :current_password
%i = f.password_field :current_password, autocomplete: 'current-password',
(#{t('.we_need_your_current_password_to_confirm_your_changes')}) placeholder: t('.we_need_your_current_password_to_confirm_your_changes')
%br/
= f.password_field :current_password, autocomplete: "current-password" .actions= f.submit t('.update')
.actions
= f.submit t('.update')
%h3= t('.cancel_my_account') %h3= t('.cancel_my_account')
%p %p
= t('.unhappy') = t('.unhappy')
= button_to t('.cancel_my_account'), send("#{resource_name}_registration_path"), data: { confirm: t('.are_you_sure') }, method: :delete = button_to t('.cancel_my_account'),
send("#{resource_name}_registration_path"),
data: { confirm: t('.are_you_sure') }, method: :delete
= link_to t('devise.shared.links.back'), :back = link_to t('devise.shared.links.back'), :back