{% extends "base.html" %}

{% block content %}
    <h1>{{ i18n.t('auth.edit_password_page_title') }}</h1>
    <form action="{{ url_for('edit_password') }}" method="post">
        {{ form.hidden_tag() }}
        <input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token }}">
        <div class="login edit-password">
            <div class="login-screen">
                <div class="app-title">
                    <h1>{{ i18n.t('auth.edit_password_page_title') }}</h1>
                </div>
     
                <div class="login-form">
                    <div class="control-group">
                      {{ form.password(placeholder=i18n.t('auth.new_password_placeholder'), type='password', autofocus=True, class_='login-field') }}
                      {% if form.password.errors %}
                          <span style="color: red;">
                          {% for error in form.password.errors %}
                            {{ error }}
                          {% endfor %}
                          </span>
                      {% endif %}
                    </div>

                    <div class="control-group">
                      {{ form.password_confirmation(placeholder=i18n.t('auth.new_password_confirm_placeholder'), type='password', class_='login-field') }}
                      {% for error in form.password_confirmation.errors %}
                        <span style="color: red;">{{ error }}</span>
                      {% endfor %}
                    </div>

                    <input type="submit" value="{{ i18n.t('auth.edit_password_button') }}" class="btn btn-primary btn-large btn-block" >
                    <br>
                </div>

                <div>
                    <a href="{{ url_for('login') }}" class="login-link">{{ i18n.t('auth.login_link') }}</a>
                </div>
            </div>
        </div>
    </form>
{% endblock %}
