{% extends 'keg-login/base.html' %}

{% block alerts %}
    {{ show_flash_messages(
        [('warning', 'Your password has expired and must be changed.')]
        if is_expired_password else []) }}
{% endblock %}

{% block main %}
{% from "keg-login/_macros.html" import render_field, render_submit_field %}

<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">Change Password</h3>
    </div>

    <div class="panel-body">
        {% block preample %}
        {% if is_expired_password %}
            <img class="center-block logo"
                 src="{{ url_for('static', filename='img/FIS-Logo-Green-login.png') }}">
        {% endif %}
        {% endblock %}

        <form action="" method="POST" class="form col-lg-6" role="form">
            {{ form.hidden_tag() }}
            {{ render_field(form.old_password, tabindex=10) }}
            {{ render_field(form.new_password, tabindex=20) }}
            {{ render_field(form.retype_password, tabindex=30) }}

            {% if is_expired_password %}
                <a href="{{ url_for('keg_login.forgot-password') }}" tabindex='195'>
                    Forgot password?
                </a>
            {% endif %}
            <input type="submit" value="Change Password" class="btn btn-success">
        </form>
    </div>
</div>
{% endblock %}
