{% extends 'scolarite/ags_base.html' %}
{% load static %}
{% load custom_tag %}
{% load custom_tag_obj %}
{% block head %}{% endblock head %}
{% block page_title %}<!--({{ue.code}}) : {{ue.libelle}}--> {% endblock page_title %}
{% block content %}


<div class="card m-3">
    <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">INFORMATIONS PERSONNELLES</h3></div>
    <div class="card-body">
        <table class="table table-bordered">
            <tr>
                <td rowspan="8" width="180">
                    {% if etudiant.avatar %}
                    <img src="{{etudiant.avatar.url}}" width="160" height="190" border="1">
                    {% else %}
                    <img src="/static/inscription/assets/img/user-default2.png" width="160" height="190" border="1">
                    {% endif %}
                    <br/><br/>
                    <a href="{% url 'Scolarite:fiche_scolarite' etudiant.id %}" target="_blank" class="btn btn-info btn-sm"><i class="fa fa-eye"></i>  voir la fiche</a><hr/>
                    {% if  etudiant|check_inscription_etudiant %} {% endif %}

                    <button class="btn btn-success btn-sm" data-toggle="modal" data-target="#inscription" {% if  etudiant|check_inscription_etudiant %} disabled{% endif %}>  Inscription Finale</button>
                    {% include 'scolarite/inscription/modal_inscription.html' %}
                </td>
            </tr>
            <tr>
                <td width="200">Status</td>
                <td>
                    {% if not NT %}
                    <span style="font-weight:bold;">En attente...</span>
                    {% else %}
                    <span style="font-weight:bold;color:green">Inscrit(e)</span>
                    {% endif %}
                </td>
            </tr>
            <tr>
                <td width="200">No. Inscription</td>
                <td><span style="color:red;font-weight:bold;">{% if etudiant.nce %}{{etudiant.nce}}{% endif %}</span></td>
            </tr>
            <tr>
                <td>Nom et prénoms</td>
                <td><span style="font-weight:bold;">{{etudiant}}</span></td>
            </tr>
            <tr>
                <td>Date et lieu de naissance</td>
                <td><span style="font-weight:bold;">{% if etudiant.datenaiss %}{{etudiant.datenaiss|date:'d-m-Y'}}{% endif %} à {% if etudiant.lieunaiss %}{{etudiant.lieunaiss}}{% endif %}</span></td>
            </tr>
            <tr>
                <td>Sexe</td>
                <td><span style="font-weight:bold;">{% if etudiant.sexe %}{{etudiant.sexe}}{% endif %}</span></td>
            </tr>
            <tr>
                <td>Contact/Email</td>
                <td><span style="font-weight:bold;">{% if etudiant.phone %}{{etudiant.phone}}{% endif %} / {{etudiant.email}}</span></td>
            </tr>
            <tr>
                <td>UFR</td>
                <td><span style="font-weight:bold;">{% if etudiant.ufr %}{{etudiant.ufr.code}} - {{etudiant.ufr.libelle}}{% endif %}</span></td>
            </tr>
        </table>
    </div>
</div>
<div class="card m-3">
    <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">TYPE DE DOCUMENT </h3></div>
    <div class="card-body">
        <table class="table table-striped">
            {% for doc in typedocs %}
            <tr>
                <td>{{doc.libelle}} &nbsp;
                    <!--{% if doc.id|check_document_add:etudiant.id %}
                    (<a target="_blank" href="{% url 'Scolarite:doc_preview' etudiant.id doc.id %}"> voir le document</a>)
                    {% endif %} -->
                </td>
                <td width="500">
                    {% if doc.id|check_document_add:etudiant.id %}
                    <a class="btn btn-secondary btn-sm" target="_blank" href="{% url 'Scolarite:doc_preview' etudiant.id doc.id %}"><i class="fa fa-eye"></i> voir le document</a>
                        {% if not doc.id|check_document_valid:etudiant.id %}
                        <button class="btn btn-success btn-sm" data-toggle="modal" data-target="#doc{{doc.id}}"> <i class="fa fa-check-square"></i>&nbsp; valider</button>
                        {% else %}
                        <img src="{% static 'inscription/assets/img/done.png' %}" width="30" height="30">
                        {% endif %}
                    {% else %}
                    <button class="btn btn-secondary btn-sm" disabled> <i class="fa fa-eye"></i> voir le document</button>
                    <button class="btn btn-success btn-sm" disabled> <i class="fa fa-check-square"></i>&nbsp; valider</button>
                    {% endif %}
                    {% include 'scolarite/inscription/modal_valid_doc.html' %}
                </td>
            </tr>
            {% empty %}
                <tr content="1"> AUCUN RESULTAT</tr>
            {% endfor %}
        </table>
    </div>
</div>



{% endblock content %}

{% block custom_js %}
<script src="{% static 'js/custom-js/save_note.js'%} "></script>
 <script src="{% static 'js/custom-js/note.js' %}"></script>
<script>
    var elements = rootElement.getElementsByClassName('delib')
</script>
{% endblock custom_js %}