<h1><%%= dgettext("mandarin.<%= schema.context_underscore %>", "Log in") %></h1>

<.form let={f} for={@conn} action={Routes.<%= schema.route_helper %>_session_path(@conn, :create)} as={:<%= schema.singular %>}>
  <%%= if @error_message do %>
    <div class="alert alert-danger">
      <p><%%= @error_message %></p>
    </div>
  <%% end %>

  <%%= forage_form_group(f, :email,
          dgettext("mandarin.<%= schema.context_underscore %>", "Email"), [],
          &forage_text_input/3) %>

  <%%= forage_form_group(f, :password,
          dgettext("mandarin.<%= schema.context_underscore %>", "Password"), [],
          &forage_password_input/3) %>

  <%%= forage_form_check(f, :remember_me,
          dgettext("mandarin.<%= schema.context_underscore %>", "Keep me logged in for 60 days"), [],
          &forage_checkbox/3) %>

  <div class="py-4">
    <%%= forage_submit dgettext("mandarin.<%= schema.context_underscore %>", "Log in") %>
  </div>
</.form>

<p>
  <%%= link dgettext("mandarin.<%= schema.context_underscore %>", "Register"), to: Routes.<%= schema.route_helper %>_registration_path(@conn, :new) %> |
  <%%= link dgettext("mandarin.<%= schema.context_underscore %>", "Forgot your password?"), to: Routes.<%= schema.route_helper %>_reset_password_path(@conn, :new) %>
</p>
