mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-06 05:55:21 +02:00
Allow users to update their email address (#1745)
* Change email address * Email confirmation * Email change test * Lint * Schema reset * Set test email sender * Select specific user fixture * Refactor/cleanup * Remove unused email_confirmation_token * Current user would never be true * Fix translation test failures
This commit is contained in:
parent
46e86a9a11
commit
41873de11d
28 changed files with 225 additions and 15 deletions
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t(".greeting") %></h1>
|
||||
|
||||
<p><%= t(".body") %></p>
|
||||
|
||||
<%= link_to @cta, @confirmation_url, class: "button" %>
|
||||
|
||||
<p class="footer"><%= t(".expiry_notice", hours: 24) %></p>
|
|
@ -0,0 +1,9 @@
|
|||
EmailConfirmation#confirmation_email
|
||||
|
||||
<%= t(".greeting") %>
|
||||
|
||||
<%= t(".body") %>
|
||||
|
||||
<%= t(".cta") %>: <%= @confirmation_url %>
|
||||
|
||||
<%= t(".expiry_notice", hours: 24) %>
|
|
@ -13,6 +13,20 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="space-y-1">
|
||||
<p class="text-sm"><%= t(".email_confirmation_title") %></p>
|
||||
<p class="text-gray-500 text-sm"><%= t(".email_confirmation_description") %></p>
|
||||
</div>
|
||||
|
||||
<%= styled_form_with model: Setting.new, url: settings_hosting_path, method: :patch, data: { controller: "auto-submit-form", "auto-submit-form-trigger-event-value" => "blur" } do |form| %>
|
||||
<div class="relative inline-block select-none">
|
||||
<%= form.check_box :require_email_confirmation, class: "sr-only peer", "data-auto-submit-form-target": "auto", "data-autosubmit-trigger-event": "input", disabled: !Current.user.admin? %>
|
||||
<%= form.label :require_email_confirmation, " ".html_safe, class: "maybe-switch" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if Setting.require_invite_for_signup %>
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
|
|
|
@ -5,10 +5,16 @@
|
|||
<h1 class="text-gray-900 text-xl font-medium mb-4"><%= t(".page_title") %></h1>
|
||||
<div class="space-y-4">
|
||||
<%= settings_section title: t(".profile_title"), subtitle: t(".profile_subtitle") do %>
|
||||
<%= styled_form_with model: @user, class: "space-y-4" do |form| %>
|
||||
<%= styled_form_with model: @user, url: user_path(@user), class: "space-y-4" do |form| %>
|
||||
<%= render "settings/user_avatar_field", form: form, user: @user %>
|
||||
|
||||
<div>
|
||||
<%= form.email_field :email, placeholder: t(".email"), label: t(".email") %>
|
||||
<% if @user.unconfirmed_email.present? %>
|
||||
<p class="mt-2 text-sm text-gray-600">
|
||||
You have requested to change your email to <%= @user.unconfirmed_email %>. Please go to your email and confirm for the change to take effect.
|
||||
</p>
|
||||
<% end %>
|
||||
<div class="grid grid-cols-2 gap-4 mt-4">
|
||||
<%= form.text_field :first_name, placeholder: t(".first_name"), label: t(".first_name") %>
|
||||
<%= form.text_field :last_name, placeholder: t(".last_name"), label: t(".last_name") %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue