{% extends 'dg_ufr/base_ufr.html' %}
{% load static %}
{% load custom_tag %}
{% block custom_css %}
{% endblock custom_css %}
{% block m-title %}(<span style="color:red">{{UFR.code}}</span>) FILTRE PAR UE : | {{get_annee}} | {{get_niveau}} | {{get_semestre}} {% endblock m-title %}
{% block content %}
<section class="content">
    <div class="container-fluid">
        <!-- Small boxes (Stat box) -->
        <div class="container">
            <div class="card">
                <div class="card-header text-white" style="background: #21618C"><h3 class="card-title"></h3>
                </div>
                <div class="card-body">
                    <form method="post" action="#">
                        {% csrf_token %}
                    <div class="row">
                        <div class="col-md-5">
                            <select name="ueval" class="form-control">
                                {% for ue in ues %}
                                <option value="{{ue.id}}">{{ue.libelle}}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="col-md-2">
                            <button type="submit" class='btn btn-primary btn-sm'><i class="fa fa-search"></i>&nbsp; Filtrer</button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>

            <div class="card">
                <div class="card-body">
                    {% if ue %}
                    <hr/>
                    <h4><i class="fa fa-database"></i> <b>RESULTAT PAR UE</b></h4>
                    <h4>UE: <b style="color:red;">({{ue.code}}) {{ue}}</b></h4>

                    <p>
                    {% if deliberation %}
                        <a class="btn btn-success btn-sm" target="_blank" href="{% url 'EspaceEnseignant:valides_ue_pdf_view' get_annee.id get_niveau.id get_semestre.id UFR.id ue.id %}" style="text-transform:uppercase;"> <i class="fa fa-print"></i> VALIDES SESSION 1</a>
                        <a class="btn btn-warning btn-sm" target="_blank" href="{% url 'EspaceEnseignant:refuses_ue_pdf_view' get_annee.id get_niveau.id get_semestre.id UFR.id ue.id %}" style="text-transform:uppercase;"> <i class="fa fa-print"></i> REFUSES SESSION 1</a>
                        <a class="btn btn-default btn-sm" target="_blank" href="{% url 'EspaceEnseignant:refuses_ue_annuel_pdf' get_annee.id get_niveau.id get_semestre.id UFR.id ue.id %}" style="text-transform:uppercase;"> <i class="fa fa-print"></i> REFUSES ANNUEL</a>
                    {% else %}
                        <button class="btn btn-success btn-sm" style="text-transform:uppercase;" disabled> <i class="fa fa-print"></i> LISTE DES VALIDES</button>
                        <button class="btn btn-warning btn-sm" style="text-transform:uppercase;" disabled> <i class="fa fa-print"></i> LISTE DES REFUSES</button>
                    {% endif %}
                    {% if deliberation %}
                        <a class="btn btn-secondary btn-sm" target="_blank" href="{% url 'EspaceEnseignant:moyenne_ue_sess_2_pdf' get_annee.id get_niveau.id get_semestre.id UFR.id ue.id %}" style="text-transform:uppercase;"> <i class="fa fa-print"></i> MOYENNE SESSION 2</a>
                    {% else %}
                        <button class="btn btn-secondary btn-sm" style="text-transform:uppercase;" disabled> <i class="fa fa-print"></i> MOYENNE SESSION 2</button>
                    {% endif %}
                    </p>
                    <br/>
                    <hr/>
                    <h4><i class="fa fa-database"></i> <b>RESULTAT PAR ECUE</b></h4>
                    <table class="table table-striped table-bordered">
                        <thead>
                            <tr>
                                <th width="50px">CODE</th>
                                <th>LIBELLE</th>
                                <th width="270px"></th>
                            </tr>
                        </thead>
                        <tbody>
                        {% for ecue in ecues %}
                            <tr>
                                <td><b>{{ecue.code}}</b></td>
                                <td>{{ecue.libelle}}</td>
                                <td width="350">
                                    {% if deliberation %}
                                    <a class="btn btn-success btn-sm" target="_blank" href="{% url 'EspaceEnseignant:valides_ecue_pdf_view' get_annee.id get_niveau.id get_semestre.id UFR.id ecue.id %}" style="text-transform:uppercase;">
                                       <i class="fa fa-print"></i> VALIDES
                                    </a>
                                    <a class="btn btn-warning btn-sm" target="_blank" href="{% url 'EspaceEnseignant:refuses_ecue_pdf_view' get_annee.id get_niveau.id get_semestre.id UFR.id ecue.id %}" style="text-transform:uppercase;">
                                       <i class="fa fa-print"></i> REFUSES
                                    </a>
                                    {% else %}
                                        <button class="btn btn-success btn-sm" style="text-transform:uppercase;" disabled> <i class="fa fa-print"></i> VALIDES</button>
                                       <button class="btn btn-warning btn-sm" style="text-transform:uppercase;" disabled> <i class="fa fa-print"></i> REFUSES</button>
                                    {% endif %}
                                    {% if deliberation and ecue.id|check_session2_delib_ecue:get_annee.id %}
                                    <a class="btn btn-secondary btn-sm" target="_blank" href="{% url 'EspaceEnseignant:note_ecue_session_2_pdf_view' get_annee.id get_niveau.id get_semestre.id UFR.id ecue.id %}" style="text-transform:uppercase;">
                                       <i class="fa fa-print"></i> NOTE SESSION 2
                                    </a>
                                    {% else %}
                                    <button class="btn btn-secondary btn-sm" style="text-transform:uppercase;" disabled> <i class="fa fa-print"></i> NOTE SESSION 2</button>
                                    {% endif %}
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                    {% endif %}
                </div>
            </div>

      </div>
    </div>
</section>
{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}