svthalia/concrexit

View on GitHub
website/templates/registration/password_change_form.html

Summary

Maintainability
Test Coverage
{% extends "small_page.html" %}
{% load i18n alert %}

{% comment %}This page is automatically used by django.contrib.auth.views{% endcomment %}

{% block title %}{% trans "Password change" %} — {{ block.super }}{% endblock %}
{% block opengraph_title %}{% trans "Password change" %} — {{ block.super }}{% endblock %}

{% block page_title %}{% trans "Password change" %}{% endblock %}

{% block page_content %}
    {% for error in form.errors.items %}
        {% for message in error.1 %}
            {% alert 'danger' message dismissible=True %}
        {% endfor %}
    {% endfor %}
    <div class="row">
        <p class="col-12">{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
        <form method="post" class="col-12 mt-3">
            {% csrf_token %}
            <div class="form-row">
                <input name="{{ form.old_password.name }}" type="password" autofocus class="form-control"
                       placeholder="{% trans "Old password" %}">
            </div>
            <div class="form-row">
                <input name="{{ form.new_password1.name }}" type="password" autofocus class="form-control"
                       placeholder="{% trans "New password" %}">
                {% if form.new_password1.help_text %}
                    <div class="help-block mt-4 mb-4">{{ form.new_password1.help_text|safe }}</div>
                {% endif %}
            </div>
            <div class="form-row">
                <input name="{{ form.new_password2.name }}" type="password" autofocus class="form-control"
                       placeholder="{% trans "Confirm new password" %}">
            </div>
            <input type="submit" value="{% trans 'Change my password' %}" class="btn btn-primary float-end"/>
        </form>
    </div>
{% endblock %}