<% if @invitation %>

Join <%= @invitation.family.name %>!

You've been invited by <%= @invitation.invited_by.email %> to join their family. Create your account to accept the invitation and start sharing location data.

Your email (<%= @invitation.email %>) will be used for this account
<% else %>

Register now!

and take control over your location data.

<% end %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), class: 'form-body', html: { data: { turbo: session[:dawarich_client] == 'ios' ? false : true } }) do |f| %> <% if @invitation %> <%= f.hidden_field :invitation_token, value: params[:invitation_token] %> <% end %>
<%= f.label :email, class: 'label' do %> Email <% end %> <%= f.email_field :email, autofocus: true, autocomplete: "email", readonly: @invitation.present?, class: "input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600 #{@invitation ? 'bg-gray-50 dark:bg-gray-600' : ''}" %>
<%= f.label :password, class: 'label' do %> Password <% end %> <% if @minimum_password_length %> (<%= @minimum_password_length %> characters minimum) <% end %>
<%= f.password_field :password, autocomplete: "new-password", class: 'input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600' %>
<%= f.label :password_confirmation, class: 'label' do %> Password Confirmation <% end %> <% if @minimum_password_length %> (<%= @minimum_password_length %> characters minimum) <% end %>
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'input input-bordered bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 border-gray-300 dark:border-gray-600' %>
<% if !DawarichSettings.self_hosted? %>
<% end %>
<%= f.submit (@invitation ? "Create Account & Join Family" : "Sign up"), class: 'btn btn-primary bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white border-none' %>
<% unless @invitation %> <%= render "devise/shared/links" %> <% end %> <% end %>