<!DOCTYPE html>
{% load static %}
{% load i18n %}
<!--
Keel (LDH middleware)
Copyright 2017-2019 Purism SPC
https://source.puri.sm/liberty/ldh_middleware
SPDX-License-Identifier: AGPL-3.0
-->

<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{% static 'layout.css' %}"/>
    <link rel="stylesheet" href="{% static 'theme.css' %}"/>
    <title>{% trans "Change Password" %}</title>
    <link rel="icon" sizes="960x960" href="{% static 'favicon.png' %}"/>
    <meta name="application-name" content="{{ site_title }}"/>
    <meta charset="UTF-8"/>
</head>

<body>

<header>

    <div id="title_box">
        <a href="{% url 'home' %}"><img class="logo" src="{% static 'logo.png' %}" alt="{{ site_title }}"/></a>
        <div id="title_text">
            <h1>{% trans "Change Password" %}</h1>
        </div>
    </div>

    <div id="log_state">
        {% if request.user.is_authenticated %}
        {% trans "Logged in as" %} {{ username }}<br/>
        <a href="{% url 'profile' %}">{% trans "Profile" %}</a> |

        {% if request.user.is_superuser %}
        <a href="{% url 'admin:index' %}">{% trans "Admin" %}</a> |
        {% endif %}

        <a href="{% url 'auth_logout' %}">{% trans "Log out" %}</a>
        {% else %}
        {% trans "You are not logged in." %}<br/>
        <a href="{% url 'auth_login' %}">{% trans "Log in" %}</a>
        <!--
        {% trans "or" %}
        <a href="{% url 'registration_register' %}">{% trans "register." %}</a>
        -->
        {% endif %}
    </div>

</header>

<hr/>

<main class="col-wrapper form">
    <article class="col-1">
<form method="post">{% csrf_token %}
<div>
{% 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>{% 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>

<fieldset>

<div >
    {{ form.old_password.errors }}
    {{ form.old_password.label_tag }} {{ form.old_password }}
</div>

<div >
    {{ form.new_password1.errors }}
    {{ form.new_password1.label_tag }} {{ form.new_password1 }}
    {% if form.new_password1.help_text %}
    <div class="help">{{ form.new_password1.help_text|safe }}</div>
    {% endif %}
</div>

<div >
{{ form.new_password2.errors }}
    {{ form.new_password2.label_tag }} {{ form.new_password2 }}
    {% if form.new_password2.help_text %}
    <div class="help">{{ form.new_password2.help_text|safe }}</div>
    {% endif %}
</div>

</fieldset>

<div >
    <input type="submit" value="{% trans 'Change my password' %}" class="default" />
</div>

</div>
</form>
</main>

<footer>
    <div id="footer_block">

        <p>
            <em>{{ site_title }}</em> provided by <a href="{{ site_provider_link }}">{{ site_provider }}</a><br />
            Code shared under AGPL-3.0-or-later
            (<a href="https://source.puri.sm/liberty/ldh_middleware">project</a>,
            <a href="{% url 'download-zip' %}">source</a>,
            <a href="{% url 'jslicense' %}" rel="jslicense">javascript</a>)
        </p>

    </div>
</footer>

</body>
</html>
