{% load i18n %}

<h1>{% trans "Login" %}</h1>

<!-- Messages -->
{% if messages %}
  <ul>
  {% for message in messages %}
    [{{ message.tags }}] {{ message }}
  {% endfor %}
  </ul>
{% endif %}

<form method="POST" action="{% url 'accounts:login' %}">
  {% csrf_token %}
  
  <!-- Email -->
  <p>
    <label>{% trans "Email" %}</label>
    <input type="text" name="email" value="{{ email }}">
  </p>
  
  <!-- Password -->
  <p>
    <label>{% trans "Password" %}</label>
    <input type="password" name="password">
  </p>
  
  <!-- Keep account logged in -->
  <p>
    <input type="checkbox" name="remember"> {% trans "Remember me" %}
  </p>

  <!-- Page to redirect after login -->
  {% if next %}
    <input type="hidden" name="next" value="{{ next }}">
  {% endif %}
  
  <!-- Submit form -->
  <p>
    <button type="submit">{% trans "Sign in" %}</button>
  </p>
</form>