{% extends 'EspaceEtudiant/base_etudiant.html' %}
{% load static %}
{% load custom_tag %}
{% load custom_tag_obj %}
{% block m-title %}<i class="fa fa-plus-square"></i> MES DEMANDES D'ACTES{% endblock m-title %}
{% load widget_tweaks %}
{% block content %}

<div class="card mb-3">
    <div class="card-header">
        <i class="fas fa-table"></i>
        LISTE DE DEMANDE
        <button data-toggle="modal" data-target="#adddemande" class="btn btn-primary btn-sm" style="float:right;"><i class="fas fa-plus"></i> Nouvelle demande</button>
        {% include 'EspaceEtudiant/parts/modal_demande_acte_add.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>DATE</th>
                    <th>TYPE</th>
                    <th>ANNEE</th>
                    <th>STATUS</th>
                </tr>
                </thead>
                <tfoot>
                <tr>
                    <th>DATE</th>
                    <th>TYPE</th>
                    <th>ANNEE</th>
                    <th>STATUS</th>
                </tr>
                </tfoot>
                <tbody>
                {% for demande in demandes %}
                            <tr>
                                <td>{{demande.created|date:'d-m-Y à H:i'}}</td>
                                <td>{{demande.type_demande}}</td>
                                <td>{{demande.annee}}</td>
                                <td>
                                    {% if demande.reception == True %}
                                    <a href="{% url 'EspaceEtudiant:download' demande.id %}" class="btn btn-success btn-sm" style="color:#fff;"><i class="fa fa-download"></i>&nbsp; Télécharger </a>
                                    {% else %}
                                    <span class="badge badge-secondary">Tritement en cours ...</span>
                                    {% endif %}
                                </td>
                            </tr>
                        {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}