{% extends 'base.html' %}

{% load static %}

{% block content %}
<main>
    <div class="container-fluid px-4">
        <h1 class="mt-4">User Profile</h1>
        <ol class="breadcrumb mb-4">
            <li class="breadcrumb-item active">Profile</li>
        </ol>
        
     
        <div class="card mb-4">
            <div class="card-header">
                <i class="fas fa-table me-1"></i>
              {{user.first_name}} {{user.last_name}} Change Password
            </div>
            <div class="card-body">
                {% if messages %}
                       {% for message in messages %}
                        {% if message.tags == 'error' %}
                       <div class="alert alert-warning alert-dismissible fade show" role="alert">
                       {{message}}
                       <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                       <span aria-hidden="true">&times;</span>
                        </button>
                         </div>
                       {% endif %}
                       {% endfor %}
                       {% endif %}
                          {% if messages %}
                       {% for message in messages %}
                        {% if message.tags == 'success' %}
                       <div class="alert alert-warning alert-dismissible fade show" role="alert">
                       {{message}}
                       <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                       <span aria-hidden="true">&times;</span>
                        </button>
                         </div>
                       {% endif %}
                       {% endfor %}
                       {% endif %}
                       <form method="POST" action="" enctype="multipart/form-data">
                        {% csrf_token %}
                
                        
                        <label for="first_name">Current Password</label>
                        <div class="form-floating mb-3">
                            <input id="password" type="password"  class="form-control" name="cpwd"  required="true">
                        </div>
                
                        <label for="last_name">New Password</label>
                        <div class="form-floating mb-3">
                            <input id="password" type="password" name="npwd" class="form-control" required="true">
                        </div>
                
                      
                        <div class="d-flex align-items-center justify-content-between mt-4 mb-0">
                            <button type="submit" class="btn btn-primary">Change</button>
                        </div>
                    </form>
            </div>
        </div>
    </div>
</main>{% endblock %}