Fix #4571: Show banner when email verification is required.
* Show a banner if the user is restricted because they signed up from a proxy or VPN. * Add an option to resend the confirmation email if your account has an unverified email address.
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
<% page_title "Change Email" %>
|
||||
|
||||
<div id="c-emails">
|
||||
<div id="a-edit">
|
||||
<h1>Change Email</h1>
|
||||
<div id="a-edit" class="fixed-width-container">
|
||||
<% if @user.email_address.present? %>
|
||||
<% page_title "Change Email" %>
|
||||
<h1>Change Email</h1>
|
||||
|
||||
<p>You must confirm your password in order to change your email address.</p>
|
||||
<p>Your current email address is <strong><%= @user.email_address.address %></strong>. You must re-enter your password in order to update your email address.</p>
|
||||
<% else %>
|
||||
<% page_title "Add Email" %>
|
||||
<h1>Add Email</h1>
|
||||
|
||||
<p>Add a new email address below. You must re-enter your password in order to update your email address.</p>
|
||||
<% end %>
|
||||
|
||||
<% if @user.is_restricted? %>
|
||||
<p>Your account is restricted because you signed up from a VPN or proxy.
|
||||
You can still use the site, but you won't be able to leave comments, edit
|
||||
tags, or upload posts until you add a verified email address to your account.</p>
|
||||
<% end %>
|
||||
|
||||
<%= edit_form_for(@user, url: user_email_path(@user)) do |f| %>
|
||||
<%= f.input :email, as: :email, label: "New Email", input_html: { value: "" } %>
|
||||
<%= f.input :password %>
|
||||
<%= f.input :email, as: :email, input_html: { value: "" } %>
|
||||
<%= f.submit "Save" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
20
app/views/emails/verify.html.erb
Normal file
20
app/views/emails/verify.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<% page_title "Verify account" %>
|
||||
|
||||
<div id="c-emails">
|
||||
<div id="a-verify" class="fixed-width-container">
|
||||
<h1>Verify account</h1>
|
||||
|
||||
<% if @user.is_restricted? %>
|
||||
<p>Your account is restricted because you signed up from a VPN or proxy.
|
||||
You can still use the site, but you won't be able to leave comments, edit
|
||||
tags, or upload posts until you verify your account.</p>
|
||||
<% end %>
|
||||
|
||||
<p>Click below to send an email to <strong><%= @email_address.address %></strong>
|
||||
to verify your account.</p>
|
||||
|
||||
<%= edit_form_for(@user, method: :post, url: send_confirmation_user_email_path(@user)) do |f| %>
|
||||
<%= f.submit "Send confirmation email" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,6 +68,8 @@
|
||||
</header>
|
||||
|
||||
<div id="page">
|
||||
<%= render "users/verification_notice" %>
|
||||
|
||||
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
|
||||
<%= render "users/upgrade_notice" %>
|
||||
<% end %>
|
||||
|
||||
10
app/views/users/_verification_notice.html.erb
Normal file
10
app/views/users/_verification_notice.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<% if CurrentUser.user.is_restricted? && (params[:controller] == "users" || cookies[:hide_verify_account_notice].blank?) %>
|
||||
<div class="notice notice-info notice-large" id="verify-account-notice">
|
||||
<h2>Your account is restricted.</h2>
|
||||
<div>
|
||||
You must verify your account because you signed up from a proxy or a VPN.
|
||||
<%= link_to "Verify your account now", verify_user_email_path(CurrentUser.user) %>.
|
||||
</div>
|
||||
<div><%= link_to "Close this", "#", id: "hide-verify-account-notice" %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -27,14 +27,14 @@
|
||||
<p>
|
||||
<% if @user.email_address.present? %>
|
||||
<%= @user.email_address.address %>
|
||||
<% if !@user.email_address.is_verified %>
|
||||
<em>(unverified)</em>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<em>blank</em>
|
||||
<% end %>
|
||||
|
||||
- <%= link_to "Change your email", edit_user_email_path(@user) %>
|
||||
(<%= link_to "Change email", edit_user_email_path(@user) %>
|
||||
<% if !@user.email_address.is_verified %>
|
||||
| <%= link_to "Verify email", verify_user_email_path(@user) %>
|
||||
<% end %>)
|
||||
<% else %>
|
||||
<%= link_to "Add email", edit_user_email_path(@user) %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user