From bfd106ba3055bebfa20c749506a550686140743c Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 2 Oct 2018 13:47:32 +0000 Subject: [PATCH] session: migrate the "token confirmation" page to the new design --- .../users/confirmations_controller.rb | 32 +++++++++++++++++++ app/views/users/confirmations/new.html.erb | 16 ---------- app/views/users/confirmations/new.html.haml | 17 ++++++++++ config/routes.rb | 1 + 4 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 app/controllers/users/confirmations_controller.rb delete mode 100644 app/views/users/confirmations/new.html.erb create mode 100644 app/views/users/confirmations/new.html.haml diff --git a/app/controllers/users/confirmations_controller.rb b/app/controllers/users/confirmations_controller.rb new file mode 100644 index 000000000..8aae938f1 --- /dev/null +++ b/app/controllers/users/confirmations_controller.rb @@ -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 diff --git a/app/views/users/confirmations/new.html.erb b/app/views/users/confirmations/new.html.erb deleted file mode 100644 index fbcac0308..000000000 --- a/app/views/users/confirmations/new.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Renvoyer les instructions de confirmation de compte

- -<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - -
- <%= f.label :email %>
- <%= f.email_field :email, autofocus: true %> -
- -
- <%= f.submit "Renvoyer les instructions de confirmation" %> -
-<% end %> - -<%= render "users/shared/links" %> diff --git a/app/views/users/confirmations/new.html.haml b/app/views/users/confirmations/new.html.haml new file mode 100644 index 000000000..0f7e6534a --- /dev/null +++ b/app/views/users/confirmations/new.html.haml @@ -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' diff --git a/config/routes.rb b/config/routes.rb index 4f35ffe32..d61486811 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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' }