mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Family invites (#1397)
* Initial pass at household invites * Invitee setup * Clean up add member form * Lint and other tweaks * Security cleanup * Lint * i18n fixes * More i18n cleanup * Show pending invites * Don't use turbo on the form * Improved email design * Basic tests * Lint * Update onboardings_controller.rb * Registration + invite cleanup * Lint * Update brakeman.ignore * Update brakeman.ignore * Self host invite links * Test tweaks * Address missing param error
This commit is contained in:
parent
09b269273a
commit
793bd852a0
26 changed files with 502 additions and 45 deletions
|
@ -1,5 +1,5 @@
|
|||
<%
|
||||
header_title t(".title")
|
||||
header_title @invitation ? t(".join_family_title", family: @invitation.family.name) : t(".title")
|
||||
%>
|
||||
|
||||
<% if self_hosted_first_login? %>
|
||||
|
@ -7,14 +7,29 @@
|
|||
<h2 class="font-bold text-xl"><%= t(".welcome_title") %></h2>
|
||||
<p class="text-gray-500 text-sm"><%= t(".welcome_body") %></p>
|
||||
</div>
|
||||
<% elsif @invitation %>
|
||||
<div class="space-y-1 mb-6 text-center">
|
||||
<p class="text-gray-500">
|
||||
<%= t(".invitation_message",
|
||||
inviter: @invitation.inviter.display_name,
|
||||
role: t(".role_#{@invitation.role}")) %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= styled_form_with model: @user, url: registration_path, class: "space-y-4" do |form| %>
|
||||
<%= form.email_field :email, autofocus: false, autocomplete: "email", required: "required", placeholder: "you@example.com", label: true %>
|
||||
<%= form.email_field :email,
|
||||
autofocus: false,
|
||||
autocomplete: "email",
|
||||
required: "required",
|
||||
placeholder: "you@example.com",
|
||||
label: true,
|
||||
disabled: @invitation.present? %>
|
||||
<%= form.password_field :password, autocomplete: "new-password", required: "required", label: true %>
|
||||
<%= form.password_field :password_confirmation, autocomplete: "new-password", required: "required", label: true %>
|
||||
<% if invite_code_required? %>
|
||||
<% if invite_code_required? && !@invitation %>
|
||||
<%= form.text_field :invite_code, required: "required", label: true, value: params[:invite] %>
|
||||
<% end %>
|
||||
<%= form.hidden_field :invitation, value: @invitation&.token %>
|
||||
<%= form.submit t(".submit") %>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue