{% extends "registration/base.html" %}

{% load i18n form_tags %}

{% block main_content %}
  <div class="login-box">
    {% if validlink %}
      <h2>{% trans "Change password" %}</h2>
      <form method="post" style="margin-top: 20px">
        {% csrf_token %}
        <div class="input-group">
          {% render_field form.new_password1 %}
        </div>
        <div class="input-group{% if form.new_password2.errors %} error{% endif %}">
          <label>{{ form.new_password2.label }}</label>
          {{ form.new_password2 }}
          {% if form.new_password2.errors %}
            <p class="error-message">
              {% for error in form.new_password2.errors %}
                {{ error }}
              {% endfor %}
            </p>
          {% endif %}
        </div>
        <button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
      </form>
    {% else %}
      <div class="mt alert-box">
        {% blocktrans trimmed %}
          The password reset link was invalid, possibly because it has already been used.
          Please request a new password reset.
        {% endblocktrans %}
      </div>
    {% endif %}
  </div>
{% endblock %}
