Display message when email has not been confirmed for new enterprise

This commit is contained in:
Rob Harrington
2015-04-15 15:32:17 +10:00
parent 2072744870
commit 0c155e6e3a
2 changed files with 11 additions and 5 deletions

View File

@@ -320,6 +320,11 @@ class Enterprise < ActiveRecord::Base
end
end
# Based on a devise method, but without adding errors
def pending_any_confirmation?
!confirmed? || pending_reconfirmation?
end
protected
def devise_mailer

View File

@@ -1,9 +1,10 @@
-if @enterprise.unconfirmed_email
-if @enterprise.pending_any_confirmation?
.alert-box
Email change is pending.
- email = @enterprise.confirmed? ? @enterprise.unconfirmed_email : @enterprise.email
Email confirmation is pending.
We've sent a confirmation email to
%strong= "#{@enterprise.unconfirmed_email}."
= link_to('Resend', main_app.enterprise_confirmation_path(enterprise: { id: @enterprise.id, email: @enterprise.unconfirmed_email } ), method: :post)
%strong= "#{email}."
= link_to('Resend', main_app.enterprise_confirmation_path(enterprise: { id: @enterprise.id, email: email } ), method: :post)
%a.close{ href: "#" } ×
.row
.alpha.three.columns
@@ -30,4 +31,4 @@
.alpha.three.columns
= f.label :website
.omega.eight.columns
= f.text_field :website, { placeholder: "eg. www.truffles.com"}
= f.text_field :website, { placeholder: "eg. www.truffles.com"}