{% extends "base_template.html" %}

{% block title %}Reset password{% endblock %}

{% block content %}

<h1 class="h2 mb-3"><b>Reset</b> password </h1>

<div class="row">
    <div class="col-md-4">
        <form action="{{ url_for('reset.reset_password', token=request.view_args['token']) }}" method="POST" id="reset_password_form">

            <div class="row">
                <div class="col-12">
                    <div class="form-group">
                        <label class="form-label" for="password">New password</label>
                        <input type="password" class="form-control" id="password" name="password" required>
                    </div>
                </div>
                <div class="col-12 mt-3">
                    <div class="form-group">
                        <label class="form-label" for="confirm_password">Confirm new password</label>
                        <input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
                    </div>
                </div>
                <div class="col-12 mt-3">
                    <button type="submit" class="btn btn-primary" id="submit_button" disabled>Update Password</button>
                </div>
            </div>
            
        </form>
        
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                <div class="mt-3">
                    {% for category, message in messages %}
                        <div class="alert alert-{{ category }}">{{ message }}</div>
                    {% endfor %}
                </div>
            {% endif %}
        {% endwith %}
    </div>
</div>

{% endblock %}
