<% content_for :title, t(".sign_a_logbook_entry") %>

<%= t(".sign_a_logbook_entry") %>

<%= t(".you_ve_been_asked_to_html", date: (fmt_date(@entry.date)), log_type: (LogbookEntry::LOG_TYPES[@entry.log_type].downcase), tail_number: @entry.aircraft.tail_number, email: @invitation.email) %>

<%= link_to t(".i_have_an_account_sign"), new_session_path, class: "btn-primary w-full justify-center" %>
<% if User.exists?(email_address: @invitation.email) %> <% elsif !@invitation.creates_account? %>

<%= t(".no_account_yet", email: @invitation.email) %>

<% else %> <% if Sso.enabled? %> <%= button_to t(".continue_with", provider: Sso.label), "/auth/#{Sso::PROVIDER}", class: "btn-secondary w-full justify-center", data: { turbo: false } %> <% end %> <% if Sso.password_login? %> <%= form_with url: account_invited_signing_path(params[:token]), class: "card card-body space-y-3" do %>

<%= t(".or_create_an_account") %>

<% if @account_errors.present? %><% end %>
<%= label_tag :name, t(".your_name"), class: "label" %><%= text_field_tag :name, params[:name], class: "input", required: true, autocomplete: "name" %>
<%= label_tag :password, t(".password"), class: "label" %><%= password_field_tag :password, nil, class: "input", required: true, autocomplete: "new-password", minlength: User::PASSWORD_MIN, maxlength: 72 %>

<%= t(".at_least_characters_not_one_html", min: User::PASSWORD_MIN) %>

<%= label_tag :password_confirmation, t(".confirm_password"), class: "label" %><%= password_field_tag :password_confirmation, nil, class: "input", required: true, autocomplete: "new-password" %>
<%= submit_tag t(".create_account"), class: "btn-secondary" %> <% end %> <% end %> <% end %>