{% extends 'dg_ufr/base_ufr.html' %}
{% load static %}
{% load custom_tag %}
{% load custom_tag_obj %}
{% block content %}
<section class="content">
    <div class="container-fluid">
        <!-- Small boxes (Stat box)-->
        <div class="container">
            <div style="text-align:center;">
                <h5>ANNEE: <span style="color:red">{{anUniv}}</span> | UE: <span style="color:red">{{getue}}</span></h5>
            </div>
            <div class="card">
                <div class="card-header text-white" style="background: #21618C">
                    MENU
                </div>
                <div class="card-body">
                    <form method="post" action="#">
                        {% csrf_token %}
                    <div class="row">
                        <div class="col-md-2">
                            <select class="form-control" name="annee">
                                <option value="tout">------- Tout ------</option>
                                {% for an in annees %}
                                <option value="{{an.id}}">{{an}}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="col-md-4" >
                            <select class="form-control" name="niveau">
                                <option value="tout">------- Tout ------</option>
                                {% for ue in UESUFR %}
                                <option value="{{ue.id}}">{{ue}}</option>
                                {% endfor %}
                            </select>
                            <input type="text" value="1" name="semestre" hidden>
                        </div>
                        <div class="col-md-2">
                            <button type="submit" name="AnneeFilter" class='btn btn-primary btn-sm'><i class="fa fa-filter"></i> Trier</button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
            <div class="card">
                <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">LISTE DES UEs </h3></div>
                <div class="card-body">
                    <button class="btn btn-success btn-sm" data-toggle="modal" data-target="#addIU"><i class="fa fa-plus"></i> Désactiver une UE</button><hr/>
                    {% include 'dg_ufr/parts/modal_add_inactive_ue.html' %}
                    <table class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th width="50"></th>
                                <th width="110">ANNEE</th>
                                <th width="110">CODE UE</th>
                                <th>LIBELLE</th>
                                <th width="100"></th>
                            </tr>
                        </thead>
                        <tbody>
                        {% for ue in UES %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{ue.annee}}</td>
                                <td>{{ue.ue.code}}</td>
                                <td>{{ue.ue.libelle}}</td>
                                <td><button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#confirm{{ue.id}}"><i class="fa fa-trash"></i> Activer</button></td>
                                {% include 'dg_ufr/parts/modal_Inactive_ue_deletion_confirm.html' %}
                            </tr>
                        {% empty %}
                            <tr>
                                <td colspan="5"><center>Aucun résultat</center></td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table><br/>
                   <!-- <div class="blog">
                        {% include 'other_admin/pagination.html' %}
                    </div> -->
                </div>
            </div>
        </div>


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

{% block custom_js %}

{% endblock custom_js %}