session: migrate the "token confirmation" page to the new design

This commit is contained in:
Pierre de La Morinerie 2018-10-02 13:47:32 +00:00
parent e87264b402
commit bfd106ba30
4 changed files with 50 additions and 16 deletions

View 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

View file

@ -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" %>

View 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'

View file

@ -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'
}