{% extends "profiles/base.html" %}
{% load i18n %}
{% load profile_tags %}
{% load perm_tags %}

{% block title %}{% trans 'Password change' %}{% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/iconrow.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/profiles.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/registration.css">
{% endblock %}

{% block body %}

<div class="t">
{% users_nav request.user user_this %}

{% users_options request.user user_this %}

<h1>{% trans 'Reset Password for ' %}</h1>
<h2><a href="{{ user_this.get_absolute_url }}">{{user_this.first_name }} {{ user_this.last_name }}</a></h2>
 <div class="clear-right"></div>

<form action="" method="post">{% csrf_token %}
<div>
{% if form.errors %}
    <p class="errornote">
    {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </p>
{% endif %}

{% if not request.user.is_superuser %}
<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="field-wrapper">
    {{ form.old_password.errors }}
    <label for="id_old_password" class="required">{% trans 'Old password' %}:</label>{{ form.old_password }}
</div>
<div class="clear-left"></div>

{%else%}
	<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
	
{% endif %}

<div class="field-wrapper">
    {{ form.new_password1.errors }}
    <label for="id_new_password1" class="required">{% trans 'New password' %}:</label>{{ form.new_password1 }}
</div>
<div class="clear-left"></div>

<div class="field-wrapper">
{{ form.new_password2.errors }}
    <label for="id_new_password2" class="required">{% trans 'Password (again)' %}:</label>{{ form.new_password2 }}
</div>
<div class="clear-left"></div>

<p>&nbsp;</p>

<div class="submit-row">
    <input type="submit" value="{% trans 'Change Password' %}" class="default" />
</div>

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

<script type="text/javascript" src="{{ STATIC_URL }}js/global/dropdown.js"></script>
<script type="text/javascript">
var iconrow = new dropdown({
	container:	'more-options-wrap',
	trigger:	'more-options-trigger',
	target:		'more-options-target'
});
</script>


{% endblock %}
