Browse Source

feat: update expired join link page

pull/1265/head
natdeanlewissoftwire 3 years ago
parent
commit
db5028c1b9
  1. 11
      app/views/devise/confirmations/expired.html.erb
  2. 29
      app/views/devise/confirmations/new.html.erb
  3. 2
      config/initializers/devise.rb
  4. 4
      db/schema.rb

11
app/views/devise/confirmations/expired.html.erb

@ -1,11 +0,0 @@
<% content_for :title, "Your invitation link has expired" %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
<%= content_for(:title) %>
</h1>
<p class="govuk-body">Contact the helpdesk to request a new one.</p>
</div>
</div>

29
app/views/devise/confirmations/new.html.erb

@ -1,29 +1,20 @@
<% content_for :title, "Resend invitation link" %>
<% content_for :title, "Expired link" %>
<% content_for :before_content do %>
<%= govuk_back_link(href: :back) %>
<% end %>
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= f.govuk_error_summary %>
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-l">
<%= content_for(:title) %>
</h1>
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<p class="govuk-body">Enter your email address to get a new invitation link.</p>
<%= f.govuk_error_summary %>
<%= f.govuk_email_field :email,
label: { text: "Email address" },
autocomplete: "email",
spellcheck: "false",
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
<p class="govuk-body">For security reasons, your join link expired - get another one using the button below (valid for 3 hours).</p>
<%= f.govuk_submit "Send email" %>
</div>
</div>
<%= f.hidden_field :email, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
<%= f.govuk_submit "Get a new join link" %>
<% end %>
<%= render "devise/shared/links" %>
</div>
</div>

2
config/initializers/devise.rb

@ -152,7 +152,7 @@ Devise.setup do |config|
# their account can't be confirmed with the token any more.
# Default is nil, meaning there is no restriction on how long a user can take
# before confirming their account.
config.confirm_within = 5.days
config.confirm_within = 3.hours
# If true, requires any email changes to be confirmed (exactly the same way as
# initial account confirmation) to be applied. Requires additional unconfirmed_email

4
db/schema.rb

@ -504,11 +504,11 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_27_102334) do
t.integer "retirement_value_check"
t.integer "hodate_check"
t.integer "extrabor_value_check"
t.integer "grant_value_check"
t.integer "staircase_bought_value_check"
t.integer "deposit_and_mortgage_value_check"
t.integer "shared_ownership_deposit_value_check"
t.integer "grant_value_check"
t.integer "old_persons_shared_ownership_value_check"
t.integer "staircase_bought_value_check"
t.integer "monthly_charges_value_check"
t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"

Loading…
Cancel
Save