From db5028c1b945073496a05f88551cfd3484c7fc5d Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 2 Feb 2023 10:50:15 +0000 Subject: [PATCH] feat: update expired join link page --- .../devise/confirmations/expired.html.erb | 11 ------- app/views/devise/confirmations/new.html.erb | 33 +++++++------------ config/initializers/devise.rb | 2 +- db/schema.rb | 4 +-- 4 files changed, 15 insertions(+), 35 deletions(-) delete mode 100644 app/views/devise/confirmations/expired.html.erb diff --git a/app/views/devise/confirmations/expired.html.erb b/app/views/devise/confirmations/expired.html.erb deleted file mode 100644 index 5a27eee4d..000000000 --- a/app/views/devise/confirmations/expired.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% content_for :title, "Your invitation link has expired" %> - -
-
-

- <%= content_for(:title) %> -

- -

Contact the helpdesk to request a new one.

-
-
diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 0f44c394f..4c1df84c9 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/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 %> +
+
+

+ <%= content_for(:title) %> +

+ <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> -<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> -
-
<%= f.govuk_error_summary %> -

- <%= content_for(:title) %> -

+

For security reasons, your join link expired - get another one using the button below (valid for 3 hours).

-

Enter your email address to get a new invitation link.

- <%= f.govuk_email_field :email, - label: { text: "Email address" }, - autocomplete: "email", - spellcheck: "false", - value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> + <%= f.hidden_field :email, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> + <%= f.govuk_submit "Get a new join link" %> + <% end %> - <%= f.govuk_submit "Send email" %> -
-<% end %> - -<%= render "devise/shared/links" %> +
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index cd1a30ee8..63389432d 100644 --- a/config/initializers/devise.rb +++ b/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 diff --git a/db/schema.rb b/db/schema.rb index 95e7799a1..d107bad1e 100644 --- a/db/schema.rb +++ b/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"