mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display message when email has not been confirmed for new enterprise
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user