push-things/django-th

View on GitHub
django_th/templates/auth/change_password.html

Summary

Maintainability
Test Coverage
{% extends "base.html" %}
{% load i18n static %}
{% load admin_urls %}

{% block content %}
<div class="col-md-12">
<!--form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form"-->
<form role="form" method="post" class="form-horizontal" action="{% url 'password_change' %}">
{% csrf_token %}

  {% if form.errors %}
    <p class="errornote">
    {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
    </p>
{% endif %}

<p>{% blocktrans with username=original %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</p>

<fieldset>
<div class="form-group">
    <label class="form-label col-md-2" for="id_username">{% trans 'Old Password' %}</label>
    <div class="col-md-10">
    {{ form.old_password }}
    {% if form.old_password.errors %}
        <p class="help-block">{{ form.old_password.errors.as_text }}</p>
    {% endif %}
    </div>
</div>
<div class="form-group">
    <label class="form-label col-md-2" for="id_username">{% trans 'Password' %}</label>
    <div class="col-md-10">
    {{ form.new_password1 }}
    {% if form.new_password1.errors %}
        <p class="help-block">{{ form.new_password1.errors.as_text }}</p>
    {% endif %}
    </div>
</div>
<div class="form-group">
    <label class="form-label col-md-2" for="id_username">{% trans 'Confirm Password' %}</label>
    <div class="col-md-10">
    {{ form.new_password2 }}
    {% if form.new_password2.errors %}
        <p class="help-block">{{ form.new_password2.errors.as_text }}</p>
    {% endif %}
    </div>
</div>
</fieldset>

<div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
        <input type="submit" class="btn btn-primary"  value="{% trans 'Change password' %}" />
        <input type="hidden" name="next" value="{{ next }}" />
    </div>
</div>
</form>
</div>
{% endblock %}