2024-02-02 09:05:04 -06:00
|
|
|
<%
|
2024-11-01 10:23:27 -05:00
|
|
|
header_title @invitation ? t(".join_family_title", family: @invitation.family.name) : t(".title")
|
2024-02-02 09:05:04 -06:00
|
|
|
%>
|
2024-09-13 17:24:19 -04:00
|
|
|
|
|
|
|
<% if self_hosted_first_login? %>
|
|
|
|
<div class="fixed inset-0 w-full h-fit bg-gray-25 p-5 border-b border-alpha-black-200 flex flex-col gap-3 items-center text-center mb-12">
|
|
|
|
<h2 class="font-bold text-xl"><%= t(".welcome_title") %></h2>
|
|
|
|
<p class="text-gray-500 text-sm"><%= t(".welcome_body") %></p>
|
|
|
|
</div>
|
2024-11-01 10:23:27 -05:00
|
|
|
<% elsif @invitation %>
|
|
|
|
<div class="space-y-1 mb-6 text-center">
|
|
|
|
<p class="text-gray-500">
|
2024-11-04 20:27:31 -05:00
|
|
|
<%= t(".invitation_message",
|
2024-11-01 10:23:27 -05:00
|
|
|
inviter: @invitation.inviter.display_name,
|
|
|
|
role: t(".role_#{@invitation.role}")) %>
|
|
|
|
</p>
|
|
|
|
</div>
|
2024-09-13 17:24:19 -04:00
|
|
|
<% end %>
|
|
|
|
|
2024-11-11 15:41:17 +01:00
|
|
|
<% if @user.errors.present? %>
|
|
|
|
<div class="text-red-600 flex items-center gap-2">
|
|
|
|
<%= lucide_icon "circle-alert", class: "w-5 h-5" %>
|
|
|
|
<p class="text-sm"><%= @user.errors.full_messages.to_sentence %></p>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2024-07-16 14:08:24 -04:00
|
|
|
<%= styled_form_with model: @user, url: registration_path, class: "space-y-4" do |form| %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<%= form.email_field :email,
|
|
|
|
autofocus: false,
|
2024-11-01 10:23:27 -05:00
|
|
|
autocomplete: "email",
|
|
|
|
required: "required",
|
|
|
|
placeholder: "you@example.com",
|
|
|
|
label: true,
|
|
|
|
disabled: @invitation.present? %>
|
2024-11-11 15:41:17 +01:00
|
|
|
<%= form.password_field :password, autocomplete: "new-password", required: "required", label: true, maxlength: 72 %>
|
2024-04-09 16:08:58 +04:00
|
|
|
<%= form.password_field :password_confirmation, autocomplete: "new-password", required: "required", label: true %>
|
2024-11-01 10:23:27 -05:00
|
|
|
<% if invite_code_required? && !@invitation %>
|
2024-10-09 13:17:58 -05:00
|
|
|
<%= form.text_field :invite_code, required: "required", label: true, value: params[:invite] %>
|
2024-02-02 17:49:28 -06:00
|
|
|
<% end %>
|
2024-11-01 10:23:27 -05:00
|
|
|
<%= form.hidden_field :invitation, value: @invitation&.token %>
|
2024-10-23 11:20:55 -04:00
|
|
|
<%= form.submit t(".submit") %>
|
2024-02-02 09:05:04 -06:00
|
|
|
<% end %>
|