{% extends "base.html" %}
{% load bootstrap3 %}
{% load i18n %}


{% block title %}{% trans "Password reset" %}{% endblock %}

{% block content %}
<div class="container">
  <div class="row">
    <div class="col-sm-offset-2 col-sm-10">
      <h1>{% trans "Password reset" %}</h1>
    </div>
  </div>

{% if validlink %}
  <form action="" method="post" role="form" class="form-horizontal">
    {% csrf_token %}
    {% bootstrap_form form layout='horizontal' %}

    {% buttons %}
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-primary">
        {% trans "Change password" %}
      </button>
    </div>
    {% endbuttons %}
  </form>

{% else %}

  <div class="row">
    <div class="alert alert-danger col-sm-offset-2 col-sm-6">
      <p class="lead"><strong>{% trans "Password reset failed" %}.</strong></p>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-offset-1 col-sm-10">
      <p class="lead">{% trans "The password reset link was invalid,
        possibly because it has already been used" %}.</p>
      <p><a href="{% url 'django.contrib.auth.views.login' %}">{% trans "Login" %}</a>
    </div>
  </div>

{% endif %}

</div>
{% endblock %}
