{% extends 'base.html' %}
{% block content %}

<div class="page-inner">
    <div class="page-header">
      <h3 class="fw-bold mb-3">Donor List</h3>
      <ul class="breadcrumbs mb-3">
        <li class="nav-home">
          <a href="#">
            <i class="icon-home"></i>
          </a>
        </li>
        <li class="separator">
          <i class="icon-arrow-right"></i>
        </li>
        <li class="nav-item">
          <a href="#">Donor List</a>
        </li>
      
        
      </ul>
    </div>
    <div class="row">
      <div class="col-md-12">
        <div class="card">
          <div class="card-header">
            <h4 class="card-title">Manage Donor List</h4>
          </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 %}
            <div class="table-responsive">
              <table
                id="basic-datatables"
                class="display table table-striped table-hover"
              >
                <thead>
                    <tr>
                        <th>#</th>
                            <th>Name</th>
                            <th>Mobile No</th>
                            <th>Email</th>
                            <th>Age</th>
                            <th>Gender</th>
                            <th>Blood Group</th>
                            <th>address</th>
                          
                            <th>action </th>
                        </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th>#</th>
                            <th>Name</th>
                            <th>Mobile No</th>
                            <th>Email</th>
                            <th>Age</th>
                            <th>Gender</th>
                            <th>Blood Group</th>
                            <th>address</th>
                         
                            <th>action </th>
                        </tr>
                </tfoot>
                <tbody>
                    {% for i in dl %}
                  <tr>
                    <td>{{forloop.counter}}</td>
                    <td>{{i.admin.first_name}} {{i.admin.last_name}}</td>
                    <td>{{i.mobilenumber}}</td>
                    <td>{{i.admin.email}}</td>
                    <td>{{i.age}}</td>
                    <td>{{i.gender}}</td>
                    <td>{{i.bloodgroup.bloodgroup}}</td>
                    <td>{{i.address}}</td>
                    {% if i.status == '0' %}
                    <td>
                        <a href="{% url 'hide_donorlist' i.id %}" class="btn btn-primary" onclick="return confirm('Do you really want to hide this detail?')">
                            Public
                        </a>
                        <a href="{% url 'delete_donor' i.id %}" class="btn btn-danger" onclick="return confirm('Do you really want to delete this detail?')">
                            Delete
                        </a>
                    </td>
                {% elif i.status == 'Hide' %}
                    <td>
                        <a href="{% url 'unhide_donorlist' i.id %}" class="btn btn-primary" onclick="return confirm('Do you really want to unhide this detail?')">
                            Hidden
                        </a>
                        <a href="{% url 'delete_donor' i.id %}" class="btn btn-danger" onclick="return confirm('Do you really want to delete this detail?')">
                            Delete
                        </a>
                    </td>
                {% endif %}
                
                  </tr>{% endfor %}
                  
                  
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>

     

     
    </div>
  </div>



{% endblock %}