{% extends 'other_admin/custom_admin_base.html' %}
{% load static %}
{% load custom_tag %}
{% load custom_tag_obj %}
{% block m-title %}LISTE DU PERSONNEL{% endblock m-title %}
{% block content %}
<div class="card mb-3">
    <div class="card-header">
        <i class="fas fa-table"></i>
        LISTE DU PERSONNEL
        <button data-toggle="modal" data-target="#addPerso" style="float:right;margin:2px;" class="btn btn-primary btn-sm" ><i class="fa fa-plus"></i> Ajouter</button>
        {% include 'other_admin/personnel/modal/modal_add_personnel.html' %}
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-bordered table-striped" id="dataTable" width="100%" cellspacing="0">
                <thead>
                <tr>
                    <th>NOM & PRENOMS</th>
                    <th>EMAIL</th>
                    <th>SERVICE ACTUEL</th>
                    <th></th>
                </tr>
                </thead>
                <tfoot>
                <tr>
                    <th>NOM & PRENOMS</th>
                    <th>EMAIL</th>
                    <th>SERVICE ACTUEL</th>
                    <th></th>
                </tr>
                </tfoot>
                <tbody>
                {% for item in personnel %}
                    <tr>
                        <td>{{ item }}</td>
                        <td>{{ item.email }}</td>
                        <td>
                            {% if item|get_pat_service:'last' %}
                                {{item|get_pat_service:'last'}}
                            {% endif %}
                        </td>
                        <td width="130">
                            <a type="button" class="btn btn-primary btn-sm " href="{% url 'BasicData:personnel_edit' item.id  %}" ><i class="fa fa-edit" title="modifier"></i></a>
                           <!-- <a type="button" class="btn btn-danger btn-sm" href="#"><i class="fa fa-trash" title="supprimer"></i></a> -->
                            <button data-toggle="modal" data-target="#addService{{item.id}}" class="btn btn-secondary btn-sm " ><i class="fa fa-plus" title="Ajouter"></i> Service</button>
                        </td>
                    </tr>
                    {% include 'other_admin/personnel/modal/modal_add_service.html' %}
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>

{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}