{% extends 'profil/profil_base.html' %}
{% load static %}
{% load custom_tag %}

{% block title %} Documents{% endblock title %}

{% block profil_content %}
<div class="row">
    <div class="col-lg-12"><br/>
        <h3><i class="bi bi-file-earmark-fill"></i> Documents</h3><hr/>
    </div>
</div>
<div class="row col-lg-11">
    <table class="table profil-cmd">
        <thead>
            <tr>
                <th></th>
                <th>TYPE DE DOCUMENT</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            {% for document in type_documents %}
            <tr>
                <td></td>
                <td>{{  document.description}}</td>
                <td>
                    {% if document.id|document_add_check:candidat.id %}
                    <img src="{% static 'assets/img/done.png' %}" class="done-ico">&nbsp;
                    <a href="{% url 'add_document' document.id %}"><i class="bi bi-pencil-fill"></i></a>&nbsp;
                    <a href="{% url 'view_document' document.id %}"><i class="bi bi-card-image"></i></a>
                    {% else %}
                    <a class="btn btn-primary" href="{% url 'add_document' document.id %}"><i class="bi bi-arrow-bar-up"></i></a>
                    {% endif %}
                </td>
            </tr>
            {% empty %}
            <tr>
                <td colspan="3" style="text-align:center;">AUCUN RESULTAT</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
        <br/><br/>
</div>
{% endblock profil_content %}