Merge pull request #2743 from betagouv/migrate-session-pages
Migration des pages de session Usager vers la nouvelle UI
This commit is contained in:
commit
9eb4c0725a
12 changed files with 92 additions and 67 deletions
|
@ -1,4 +1,4 @@
|
|||
.administrateurs-activate.container {
|
||||
.container.devise-container {
|
||||
margin-top: 60px;
|
||||
margin-bottom: 60px;
|
||||
}
|
32
app/controllers/users/confirmations_controller.rb
Normal file
32
app/controllers/users/confirmations_controller.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Users::ConfirmationsController < Devise::ConfirmationsController
|
||||
layout "new_application"
|
||||
|
||||
# GET /resource/confirmation/new
|
||||
# def new
|
||||
# super
|
||||
# end
|
||||
|
||||
# POST /resource/confirmation
|
||||
# def create
|
||||
# super
|
||||
# end
|
||||
|
||||
# GET /resource/confirmation?confirmation_token=abcdef
|
||||
# def show
|
||||
# super
|
||||
# end
|
||||
|
||||
# protected
|
||||
|
||||
# The path used after resending confirmation instructions.
|
||||
# def after_resending_confirmation_instructions_path_for(resource_name)
|
||||
# super(resource_name)
|
||||
# end
|
||||
|
||||
# The path used after confirmation.
|
||||
# def after_confirmation_path_for(resource_name, resource)
|
||||
# super(resource_name, resource)
|
||||
# end
|
||||
end
|
|
@ -1,4 +1,6 @@
|
|||
class Users::PasswordsController < Devise::PasswordsController
|
||||
layout "new_application"
|
||||
|
||||
after_action :try_to_authenticate_gestionnaire, only: [:update]
|
||||
after_action :try_to_authenticate_administrateur, only: [:update]
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
- content_for :footer do
|
||||
= render partial: "root/footer"
|
||||
|
||||
.administrateurs-activate.container
|
||||
.container.devise-container
|
||||
.one-column-centered
|
||||
= form_for @administrateur, url: { controller: 'administrateurs/activate', action: :create }, html: { class: "form" } do |f|
|
||||
%br
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
|
||||
%br
|
||||
%h4
|
||||
= f.label 'Retaper le mot de passe'
|
||||
= f.label 'Confirmez le nouveau mot de passe'
|
||||
.input-group
|
||||
.input-group-addon
|
||||
%span.fa.fa-asterisk
|
||||
|
@ -25,5 +25,5 @@
|
|||
%br
|
||||
%br
|
||||
.actions
|
||||
= f.submit "Changer", class: 'btn btn-primary'
|
||||
= f.submit 'Changer le mot de passe', class: 'btn btn-primary'
|
||||
%br
|
||||
|
|
|
@ -17,5 +17,5 @@
|
|||
%br
|
||||
%br
|
||||
.actions
|
||||
= f.submit "Renvoyer", class: 'btn btn-primary'
|
||||
= f.submit 'Réinitialiser', class: 'btn btn-primary'
|
||||
%br
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
<h2>Renvoyer les instructions de confirmation de compte</h2>
|
||||
|
||||
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :email %><br />
|
||||
<%= f.email_field :email, autofocus: true %>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit "Renvoyer les instructions de confirmation" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= render "users/shared/links" %>
|
17
app/views/users/confirmations/new.html.haml
Normal file
17
app/views/users/confirmations/new.html.haml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- content_for(:title, 'Renvoyer les instructions de confirmation de compte')
|
||||
|
||||
- content_for :footer do
|
||||
= render partial: 'root/footer'
|
||||
|
||||
.container.devise-container
|
||||
.one-column-centered
|
||||
= devise_error_messages!
|
||||
|
||||
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { class: 'form' }) do |f|
|
||||
|
||||
%h1 Renvoyer les instructions de confirmation de compte
|
||||
|
||||
= f.label :email, 'Email'
|
||||
= f.email_field :email, autofocus: true
|
||||
|
||||
= f.submit 'Renvoyer les instructions de confirmation', class: 'button primary'
|
|
@ -1,29 +1,22 @@
|
|||
= devise_error_messages!
|
||||
- content_for(:title, 'Changement de mot de passe')
|
||||
|
||||
#form-login
|
||||
%h2#gestionnaire_login Changement de mot de passe
|
||||
- content_for :footer do
|
||||
= render partial: 'root/footer'
|
||||
|
||||
.container.devise-container
|
||||
.one-column-centered
|
||||
= devise_error_messages!
|
||||
|
||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :patch, class: 'form' }) do |f|
|
||||
|
||||
%h1 Changement de mot de passe
|
||||
|
||||
%br
|
||||
%br
|
||||
#new-user
|
||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
|
||||
= f.hidden_field :reset_password_token
|
||||
%h4
|
||||
= f.label 'Nouveau mot de passe'
|
||||
|
||||
.input-group
|
||||
.input-group-addon
|
||||
%span.fa.fa-asterisk
|
||||
= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control'
|
||||
%br
|
||||
%h4
|
||||
= f.label 'Retaper le mot de passe'
|
||||
.input-group
|
||||
.input-group-addon
|
||||
%span.fa.fa-asterisk
|
||||
= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control'
|
||||
%br
|
||||
%br
|
||||
.actions
|
||||
= f.submit "Changer", class: 'btn btn-primary'
|
||||
%br
|
||||
= f.label 'Nouveau mot de passe'
|
||||
= f.password_field :password, autofocus: true, autocomplete: 'off'
|
||||
|
||||
= f.label 'Confirmez le nouveau mot de passe'
|
||||
= f.password_field :password_confirmation, autocomplete: 'off'
|
||||
|
||||
= f.submit 'Changer le mot de passe', class: 'button primary'
|
||||
|
|
|
@ -1,21 +1,17 @@
|
|||
= devise_error_messages!
|
||||
- content_for(:title, 'Mot de passe oublié')
|
||||
|
||||
%br
|
||||
#form-login
|
||||
%h2#gestionnaire_login Mot de passe oublié
|
||||
- content_for :footer do
|
||||
= render partial: 'root/footer'
|
||||
|
||||
%br
|
||||
%br
|
||||
#new-user
|
||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
|
||||
%h4
|
||||
= f.label :email
|
||||
.input-group
|
||||
.input-group-addon
|
||||
%span.fa.fa-user
|
||||
= f.email_field :email, class: 'form-control', placeholder: 'Email'
|
||||
%br
|
||||
%br
|
||||
.actions
|
||||
= f.submit "Renvoyer", class: 'btn btn-primary'
|
||||
%br
|
||||
.container.devise-container
|
||||
.one-column-centered
|
||||
= devise_error_messages!
|
||||
|
||||
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: 'form' }) do |f|
|
||||
|
||||
%h1 Mot de passe oublié
|
||||
|
||||
= f.label :email, 'Email'
|
||||
= f.email_field :email, autofocus: true
|
||||
|
||||
= f.submit 'Réinitialier', class: 'button primary'
|
||||
|
|
|
@ -15,7 +15,7 @@ fr:
|
|||
not_found_in_database: "adresse email ou mot de passe invalide."
|
||||
timeout: "Votre session est expirée. Veuillez vous reconnecter pour continuer."
|
||||
unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer."
|
||||
unconfirmed: "Vous devez activer votre compte pour continuer."
|
||||
unconfirmed: "Vous devez confirmer votre adresse email pour continuer. Cliquez sur le lien qui vous a été envoyé par email."
|
||||
mailer:
|
||||
confirmation_instructions:
|
||||
subject: "Instructions d'activation de votre compte"
|
||||
|
@ -34,7 +34,7 @@ fr:
|
|||
no_token: "Vous ne pouvez accéder à cette page sans passer par un email de réinitialisation de mot de passe. Si vous êtes passé par un email de ce type, assurez-vous d'utiliser l'URL complète."
|
||||
send_instructions: "Vous allez recevoir les instructions de réinitialisation du mot de passe dans quelques instants"
|
||||
send_paranoid_instructions: "Si votre adresse email existe dans notre base de données, vous allez recevoir un lien de réinitialisation par email"
|
||||
updated: "Votre mot de passe a été édité avec succès, vous êtes maintenant connecté"
|
||||
updated: "Votre mot de passe a été changé avec succès, vous êtes maintenant connecté"
|
||||
updated_not_active: "Votre mot de passe a été changé avec succès."
|
||||
registrations:
|
||||
destroyed: "Votre compte a été supprimé avec succès. Nous espérons vous revoir bientôt."
|
||||
|
|
|
@ -73,6 +73,7 @@ Rails.application.routes.draw do
|
|||
devise_for :users, controllers: {
|
||||
sessions: 'users/sessions',
|
||||
registrations: 'users/registrations',
|
||||
confirmations: 'users/confirmations',
|
||||
passwords: 'users/passwords'
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue