{% extends "charme_base.html" %}

{% load i18n %}

{% block main %}

<form action="" method="post">{% csrf_token %}

<h2>{% trans 'Password change' %}</h2>

{% if user_form.non_field_errors %}
<div class=error>
	<ul>
		<li>{{ user_form.non_field_errors }}</li>
	</ul>
</div>
{% endif %}

<p>{% 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>

<div class=contactform id="password_change">
	<div class=accounts>
		<table>
			<tr>
				<td><label>{% trans "Old password:" noop %}</label></td>
				<td>{{ form.old_password }}</td>
				<td class=error>{{ form.old_password.errors }}</td>
			</tr>
			<tr>
				<td><label>{% trans "New password:" noop %}</label></td>
				<td>{{ form.new_password1 }}</td>
				<td class=error>{{ form.new_password1.errors }}</td>
			</tr>
			<tr>
				<td><label>{% trans "Password (again):" noop %}</label></td>
				<td>{{ form.new_password2 }}</td>
				<td class=error>{{ form.new_password2.errors }}</td>
			</tr>
			<tr>
				<td></td>
				<td style="text-align: right;"><input type="submit"
						value="{% trans 'Change my password' %}">
						<input type="button"
						onclick="location.href='{% url 'profile' %}'"
						value="Cancel" /></td>
				<td></td>
			</tr>
		</table>
	</div>
</div>

<script type="text/javascript">document.getElementById("id_old_password").focus();</script>

</form>

{% endblock %}
