From 65133515dc992e9829f2b65a37275d029c3db237 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sat, 15 Aug 2015 05:59:46 +0300 Subject: [PATCH] Fix Devise views --- .../devise/mailer/confirmation_instructions.text.erb | 5 +++++ .../devise/mailer/reset_password_instructions.text.erb | 8 ++++++++ lib/initfest/views/devise/confirmations/new.slim | 4 ++-- lib/initfest/views/devise/passwords/edit.slim | 4 ++-- lib/initfest/views/devise/passwords/new.slim | 4 ++-- lib/initfest/views/devise/registrations/edit.slim | 2 +- lib/initfest/views/devise/registrations/new.slim | 4 ++-- lib/initfest/views/devise/sessions/new.slim | 2 +- 8 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 app/views/devise/mailer/confirmation_instructions.text.erb create mode 100644 app/views/devise/mailer/reset_password_instructions.text.erb diff --git a/app/views/devise/mailer/confirmation_instructions.text.erb b/app/views/devise/mailer/confirmation_instructions.text.erb new file mode 100644 index 0000000..b80b172 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.text.erb @@ -0,0 +1,5 @@ +<%= t(:welcome, name: @email) %>! + +<%= t(:confirm_by_clicking) %> + +<%= confirmation_url(@resource, confirmation_token: @token) %> diff --git a/app/views/devise/mailer/reset_password_instructions.text.erb b/app/views/devise/mailer/reset_password_instructions.text.erb new file mode 100644 index 0000000..f0089f8 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.text.erb @@ -0,0 +1,8 @@ +<%= t(:hello, name: @resource.email) %>! + +<%= t(:someone_requested_passreset) %> + +<%= edit_password_url(@resource, reset_password_token: @token) %> + +<%= t(:do_not_want_pass_reset1) %> +<%= t(:do_not_want_pass_reset2) %> diff --git a/lib/initfest/views/devise/confirmations/new.slim b/lib/initfest/views/devise/confirmations/new.slim index d0dad8b..ec3f53b 100644 --- a/lib/initfest/views/devise/confirmations/new.slim +++ b/lib/initfest/views/devise/confirmations/new.slim @@ -1,8 +1,8 @@ -- content_for(:title) { ":: #{t :resend_instructions_header}" } +- content_for(:title) { "#{t :resend_instructions_header}" } h2.entry-title = t :resend_instructions_header -= simple_form_for(resource, wrapper: :default, as: :user, url: user_confirmation_path) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| = f.error_notification = f.full_error :confirmation_token diff --git a/lib/initfest/views/devise/passwords/edit.slim b/lib/initfest/views/devise/passwords/edit.slim index a49e4bc..b482ae7 100644 --- a/lib/initfest/views/devise/passwords/edit.slim +++ b/lib/initfest/views/devise/passwords/edit.slim @@ -1,8 +1,8 @@ -- content_for(:title) { ":: #{t :change_pass}" } +- content_for(:title) { "#{t :change_pass}" } h2.entry-title = t :change_pass -= simple_form_for(resource, wrapper: :default, as: :user, url: user_password_path, html: { method: :put }) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| = f.error_notification = f.input :reset_password_token, as: :hidden diff --git a/lib/initfest/views/devise/passwords/new.slim b/lib/initfest/views/devise/passwords/new.slim index 55f2297..f922c41 100644 --- a/lib/initfest/views/devise/passwords/new.slim +++ b/lib/initfest/views/devise/passwords/new.slim @@ -1,8 +1,8 @@ -- content_for(:title) { ":: #{t :lostpass}" } +- content_for(:title) { "#{t :lostpass}" } h2.entry-title = t :lostpass -= simple_form_for(resource, wrapper: :default, as: :user, url: user_password_path) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| = f.error_notification .form-inputs diff --git a/lib/initfest/views/devise/registrations/edit.slim b/lib/initfest/views/devise/registrations/edit.slim index 6bfc02b..2cce2ab 100644 --- a/lib/initfest/views/devise/registrations/edit.slim +++ b/lib/initfest/views/devise/registrations/edit.slim @@ -1,6 +1,6 @@ - content_for(:title) { t :edit_speaker_profile } -= simple_form_for(resource, wrapper: :default, as: :user, url: user_registration_path, html: { method: :put, multipart: true }) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f| .form_inputs / h2 / - if current_user.personal_profile(current_conference).present? diff --git a/lib/initfest/views/devise/registrations/new.slim b/lib/initfest/views/devise/registrations/new.slim index bb5f2c2..701848f 100644 --- a/lib/initfest/views/devise/registrations/new.slim +++ b/lib/initfest/views/devise/registrations/new.slim @@ -1,8 +1,8 @@ -- content_for(:title) { ":: #{t :registration}" } +- content_for(:title) { "#{t :registration}" } h2.entry-title = t :registration -= simple_form_for(resource, wrapper: :default, as: :user, url: user_registration_path) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: registration_path(resource_name)) do |f| = f.error_notification .form-inputs diff --git a/lib/initfest/views/devise/sessions/new.slim b/lib/initfest/views/devise/sessions/new.slim index db5c6aa..88d20b9 100644 --- a/lib/initfest/views/devise/sessions/new.slim +++ b/lib/initfest/views/devise/sessions/new.slim @@ -2,7 +2,7 @@ h2.entry-title = t :login -= simple_form_for(resource, wrapper: :default, as: :user, url: user_session_path) do |f| += simple_form_for(resource, wrapper: :default, as: resource_name, url: session_path(resource_name)) do |f| .form-inputs = f.input :email, required: false, autofocus: true, hint: false = f.input :password, required: false, hint: false