From 7e78b7d62d9ac7dec5711a1758f25821e5e56786 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 12 Aug 2019 13:41:43 +0200 Subject: [PATCH] Administrateur password, remove one level of indirection --- .../administrateurs/activate/new.html.haml | 18 +++++++++++++++++- app/views/shared/password/_new.html.haml | 18 ------------------ 2 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 app/views/shared/password/_new.html.haml diff --git a/app/views/administrateurs/activate/new.html.haml b/app/views/administrateurs/activate/new.html.haml index 760f52106..b447c8bab 100644 --- a/app/views/administrateurs/activate/new.html.haml +++ b/app/views/administrateurs/activate/new.html.haml @@ -3,4 +3,20 @@ - content_for :footer do = render partial: "root/footer" -= render 'shared/password/new', object: @administrateur, controller: 'administrateurs/activate', test_password_strength: administrateurs_password_test_strength_path +.container.devise-container + .one-column-centered + = form_for @administrateur, url: { controller: 'administrateurs/activate', action: :create }, html: { class: "form" } do |f| + %br + %h1 + Choix du mot de passe + + = f.hidden_field :reset_password_token, value: @administrateur.reset_password_token + = f.label :email, "Email" + = f.text_field :email, disabled: true + + = f.label :password do + Mot de passe + + = render partial: 'shared/password/edit_password', locals: { form: f, controller: 'administrateurs/passwords' } + + = f.submit 'Continuer', class: 'button large primary expand', id: "submit-password", data: { disable_with: "Envoi..." } diff --git a/app/views/shared/password/_new.html.haml b/app/views/shared/password/_new.html.haml deleted file mode 100644 index 7ba2e7034..000000000 --- a/app/views/shared/password/_new.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -.container.devise-container - .one-column-centered - - controller_action = defined?(action) ? action : :create - = form_for object, url: { controller: controller, action: controller_action }, html: { class: "form" } do |f| - %br - %h1 - Choix du mot de passe - - = f.hidden_field :reset_password_token, value: object.reset_password_token - = f.label :email, "Email" - = f.text_field :email, disabled: true - - = f.label :password do - Mot de passe - - = render partial: 'shared/password/edit_password', locals: { form: f, controller: controller } - - = f.submit 'Continuer', class: 'button large primary expand', id: "submit-password", data: { disable_with: "Envoi..." }