{% extends "base.html" %}
{% load wagtailcore_tags %}
{% wagtail_site as current_site %}
{% block content %}
<div class="profiles">
  {% trans "Log in" as headingtext %}
  {% include "patterns/basics/headings/sp_variations/heading.html" with type="component" htmltag="h1" title=headingtext %}
  {% trans "Not a member yet?" as headingtext %}
  {% trans "Sign up here" as linktext %}
  {% include "patterns/basics/headings/sp_variations/heading.html" with type="micro" htmltag="p" title=headingtext hyperlink=REGISTRATION_URL linktitle=linktext %}
  <form method="post" action="." class="profiles__form" novalidate>
  {% csrf_token %}
    {% if form.errors %}
    <p class="errors">
      {% trans "Your username and password do not match. Please try again." %}
    </p>
    {% endif %}
    <fieldset>
      <label>{% trans "Username" %}</label>
      {{form.username}}
    </fieldset>
    <fieldset>
      <label>{% trans "4-digit pin" %}</label>
      {{form.password}}
    </fieldset>
    <button type="submit" class="call-to-action__button call-to-action__button--primary">{% trans "Log in" %}</button>
    <input type="hidden" name="next" value="{% if request.GET.next %}{{ request.GET.next }}{% else %}{{current_site.root_page.specific.url}}{% endif %}" />
    {% url "forgot_password" as link %}
    {% trans "Forgot PIN" as buttontext %}
    {% include "patterns/basics/buttons/sp_variations/button.html" with type="hyperlink" hyperlink=link text=buttontext %}
  </form>
</div>
{% endblock %}
