{% extends 'EspaceEtudiant/base_etudiant.html' %}
{% load static %}
{% load custom_tag %}
{% load custom_tag_obj %}
{% block page_title %}{% endblock page_title %}
{% block content %}
{% load unicorn %}
{% unicorn_scripts %}

<section class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">MENU</h3></div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-3">
                                <label>1 - Ajouter les documents</label>
                                <button class='btn btn-primary' data-toggle="modal" data-target="#addoc"><span style="background-color:#fff;color:red;border-radius:50%;padding:6px 12px;font-weight:bold;">1</span> &nbsp; Ajout de document</button>
                                {% include 'EspaceEtudiant/parts/modal_doument_add.html' %}
                            </div>
                            <div class="col-md-4">
                                {% if not insc_sent %}
                                <label>2 - Demander une inscription</label>
                                <button class='btn btn-primary' data-toggle="modal" data-target="#inscpost"><span style="background-color:#fff;color:red;border-radius:50%;padding:6px 12px;font-weight:bold;">2</span> &nbsp; Demander une inscription</button>
                                {% include 'EspaceEtudiant/parts/modal_send_inscription.html' %}
                                {% else %}
                                <span>
                                    <label>2 - Demander une inscription</label><br/>
                                    <img src="{% static 'inscription/assets/img/done.png' %}" width="30" height="30">
                                    <span style="color:#7AEF2F;"> Demande envoyée</span>
                                </span>
                                {% endif %}
                            </div>

                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</section>

<div class="card mb-3">
    <div class="card-header">
        <i class="fas fa-table"></i>
        LISTE DE DOCUMENTS AJOUTES
    </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></th>
                    <th>DATE</th>
                    <th>TYPE DE DOCUMENT</th>
                    <th></th>
                </tr>
                </thead>
                <tfoot>
                <tr>
                    <th></th>
                    <th>DATE</th>
                    <th>TYPE DE DOCUMENT</th>
                    <th></th>
                </tr>
                </tfoot>
                <tbody>
                {% for tpdoc in documents%}
                <tr>
                    <td width="15">{{forloop.counter}}</td>
                    <td width="100">{{tpdoc.created|date:'d-m-Y'}}</td>
                    <td>{{tpdoc.typedoc.libelle}}</td>
                    <td width="100">
                        <a class="btn btn-warning btn-sm" target="_blank" href="{% url 'Scolarite:doc_preview' etudiant.id tpdoc.typedoc.id %}"><i class="fa fa-eye"></i> voir</a>
                        {% if tpdoc.valid == True %}
                        <img src="{% static 'inscription/assets/img/done.png' %}" width="30" height="30">
                        {% endif %}
                    </td>
                </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>
{% endblock content %}

{% block custom_js %}
{% endblock custom_js %}