From b1e98bd92f4d6a0211e4f3abcedb0fe726e23e5f Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 31 Mar 2014 14:25:56 +0400 Subject: [PATCH] Fixed: confirmation_instructions --- app/controllers/users/confirmations_controller.rb | 3 +++ app/views/devise/confirmations/new.html.haml | 12 +++++------- .../devise/mailer/confirmation_instructions.en.haml | 2 +- .../devise/mailer/confirmation_instructions.ru.haml | 2 +- config/locales/devise.en.yml | 3 +++ config/locales/devise.ru.yml | 3 +++ config/routes.rb | 5 ++++- 7 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 app/controllers/users/confirmations_controller.rb diff --git a/app/controllers/users/confirmations_controller.rb b/app/controllers/users/confirmations_controller.rb new file mode 100644 index 000000000..9fa4f9fe1 --- /dev/null +++ b/app/controllers/users/confirmations_controller.rb @@ -0,0 +1,3 @@ +class Users::ConfirmationsController < Devise::ConfirmationsController + layout 'application' +end diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index b4fa14592..899bd28b6 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,5 +1,5 @@ .block - %h2= title t("devise.confirmations.resend_header") + %h2= title t("devise.confirmations.new.title") .content - if resource.errors.present? .flash @@ -10,14 +10,12 @@ = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: "form" }) do |f| = f.hidden_field :reset_password_token .group.wat-cf - .left - = f.label :email, class: "label" - .right - = f.text_field :email, class: "text_field" + = f.label :email, class: "label" + = f.text_field :email, class: "text_field" .group.navform.wat-cf %button.button{tyle: "submit"} - = image_tag("choose.png", alt: t("devise.confirmations.send")) - = t("devise.confirmations.send") + = image_tag("choose.png", alt: t("devise.confirmations.new.submit_html")) + = t("devise.confirmations.new.submit_html") %span.text_button_padding = render "devise/shared/links" \ No newline at end of file diff --git a/app/views/devise/mailer/confirmation_instructions.en.haml b/app/views/devise/mailer/confirmation_instructions.en.haml index 398c38d2b..27b54554f 100644 --- a/app/views/devise/mailer/confirmation_instructions.en.haml +++ b/app/views/devise/mailer/confirmation_instructions.en.haml @@ -1,6 +1,6 @@ %p Welcome #{@resource.email}! %p You can confirm your account through the link below: -%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) +%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %br %p== Support team «ROSA ABF» diff --git a/app/views/devise/mailer/confirmation_instructions.ru.haml b/app/views/devise/mailer/confirmation_instructions.ru.haml index 167378049..88caad2cc 100644 --- a/app/views/devise/mailer/confirmation_instructions.ru.haml +++ b/app/views/devise/mailer/confirmation_instructions.ru.haml @@ -1,6 +1,6 @@ %p Здравствуйте, #{@resource.email}! %p Вы можете подтвердить свой аккаунт, перейдя по ссылке снизу: -%p= link_to 'Подтвердить мой аккаунт', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) +%p= link_to 'Подтвердить мой аккаунт', confirmation_url(@resource, confirmation_token: @token) %br %p== Команда поддержки «ROSA ABF» diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 0dceccf2d..be6968e6e 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -38,6 +38,9 @@ en: send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.' confirmed: 'Your account was successfully confirmed. You are now signed in.' + new: + title: "Resend confirmation instructions" + submit_html: "Resend the instructions »" registrations: signed_up: 'Welcome! You have signed up successfully.' signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.' diff --git a/config/locales/devise.ru.yml b/config/locales/devise.ru.yml index b25fd5976..f63a68ffd 100644 --- a/config/locales/devise.ru.yml +++ b/config/locales/devise.ru.yml @@ -41,6 +41,9 @@ ru: send_paranoid_instructions: 'Если Ваш e-mail существует, то в течение нескольких минут вы получите e-mail с инструкциями по подтверждению вашей учётной записи.' confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему." error: "Неверный код подтверждения." + new: + title: "Отправить инструкцию по подтверждению учётной записи" + submit_html: "Отправить инструкцию »" registrations: signed_up: "Добро пожаловать! Вы успешно зарегистрировались." signed_up_but_unconfirmed: 'Сообщение для подтверждения учетной записи было отправлено на Ваш email. Пожалуйста откройте ссылку из письма для активации.' diff --git a/config/routes.rb b/config/routes.rb index bc6ffc4cb..1e868fb64 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,10 @@ Rosa::Application.routes.draw do post 'users' => 'users/registrations#create', as: :user_registration end - devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }, skip: [:registrations] + devise_for :users, controllers: { + omniauth_callbacks: 'users/omniauth_callbacks', + confirmations: 'users/confirmations' + }, skip: [:registrations] namespace :api do namespace :v1 do