From 28e4f9740ede54ff83d2c431bf56e2e5aa8e89b2 Mon Sep 17 00:00:00 2001 From: Bruno Perles Date: Fri, 13 Nov 2015 14:53:53 +0100 Subject: #35883 - Add confirm link to send confirmation email --- app/views/devise/confirmations/new.html.erb | 36 ++++++++++++++++++----------- app/views/devise/sessions/new.html.erb | 14 ++++------- app/views/devise/shared/_intro.html.erb | 9 ++++++++ config/locales/devise.en.yml | 2 +- config/locales/devise.fr.yml | 4 ++-- 5 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 app/views/devise/shared/_intro.html.erb diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 1e221155c..dae3f3023 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,13 +1,23 @@ -<%= title_tag t('.title') %> - -<%= semantic_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |form| %> - - <%= form.input :email %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button, :label => t('.title') %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<%= render "links" %> +
+ <%= render 'devise/shared/intro' %> +
+
+
<%= t('.title') %>
+
+ <%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :wrapper => "form_without_label", html: { :class => 'form-horizontal user', method: :post } ) do |form| %> + <%= form.input :email, :label => false, input_html: { :class => "form-control" } %> +
+
+ <%= form.button :submit, t('.title'), :class => "btn-primary" %> +
+
+
+
+ <%= link_to t('devise.links.sign_in'), new_session_path(resource_name) %> +
+
+ <% end %> +
+
+
+
diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 35b874e64..2df4f3d97 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,13 +1,5 @@
-
-

<%= t(".welcome") %>

-

<%= t(".introduction1") %>

-

<%= t(".introduction2") %>

- -
+ <%= render 'devise/shared/intro' %>
@@ -29,6 +21,10 @@
<%= link_to t("devise.links.new_password"), new_password_path(resource_name) %> + <% if devise_mapping.confirmable? && controller_name != 'confirmations' %> +
+ <%= link_to t("devise.links.new_confirmation"), new_confirmation_path(resource_name) %> + <% end %>
<% end %> diff --git a/app/views/devise/shared/_intro.html.erb b/app/views/devise/shared/_intro.html.erb new file mode 100644 index 000000000..b56559352 --- /dev/null +++ b/app/views/devise/shared/_intro.html.erb @@ -0,0 +1,9 @@ +
+

<%= t("devise.sessions.new.welcome") %>

+

<%= t("devise.sessions.new.introduction1") %>

+

<%= t("devise.sessions.new.introduction2") %>

+
    +
  • - <%= t("devise.sessions.new.introduction_item1") %>
  • +
  • - <%= t("devise.sessions.new.introduction_item2") %>
  • +
+
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index d4cf9c525..25a5bbeba 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -39,7 +39,7 @@ validating conformance of data wrt Neptune (French standard NFP 99 506)." sign_in: "Sign in" sign_up: "Sign up" new_password: Forget your password ? - new_confirmation: "Didn't receive confirmation instructions?" + new_confirmation: "Confirm my account" simple_form: labels: user: diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml index 5f4b5089a..b909eeaef 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise.fr.yml @@ -39,8 +39,8 @@ norme Neptune (NFP 99 506)" links: sign_in: "Se connecter" sign_up: "S'inscrire" - new_password: "Mot de passe oublié?" - new_confirmation: "Vous n'avez pas reçu les instructions de confirmation ?" + new_password: "Mot de passe oublié ?" + new_confirmation: "Confirmer mon compte" simple_form: labels: user: -- cgit v1.2.3