{% extends 'base.html' %}
{% block content %}
<div class="row">
    <div class="col-md-6 grid-margin stretch-card">
      <div class="card">
        <div class="card-body">
          <h4 class="card-title">Admin Profile</h4>
          {% 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 class="forms-sample"  method="POST" action="{% url 'admin_profile_update' %}" enctype="multipart/form-data">
            {% csrf_token %}

            <div class="form-group">
              <label for="exampleInputUsername1">Profile Pic</label>
              <input type="file" class="form-control" name="profile_pic">
            </div>
            <div class="form-group">
              <label for="exampleInputEmail1">First Name</label>
              <input type="text" class="form-control" name="first_name" value="{{user.first_name}}">
            </div>
            <div class="form-group">
                <label for="exampleInputPassword1">Last Name</label>
                <input type="text" class="form-control" name="last_name" value="{{user.last_name}}">
              </div>
            <div class="form-group">
                <label for="exampleInputConfirmPassword1">Email</label>
                <input type="email" class="form-control" readonly="True" name="email" value="{{user.email}}">
              </div>
              <div class="form-group">
                  <label for="exampleInputConfirmPassword1">Username</label>
                  <input type="text" class="form-control" readonly="True" name="username" value="{{user.username}}">
                </div>
            
            <button type="submit" class="btn btn-primary mr-2">Update</button>
         
          </form>
        </div>
      </div>
    </div>
    
    </div>

 {% endblock %}