{% extends 'EspaceEnseignant/base_enseignant.html' %}
{% load static %}
{% load unicorn %}
{% unicorn_scripts %}
{% block page_title %}{{page_title}}{% endblock page_title %}
{% block content %}
<section class="content">
    <div class="container-fluid">
        <!-- Small boxes (Stat box) -->
        {% include "EspaceEnseignant/infos.html" %}
        <div class="container">
            <div class="card">
                <div class="card-header text-white" style="background: #21618C"><h3 class="card-title">MENU</h3></div>
                <div class="card-body">
                    {% if  delib and delib.user.email == request.user.email %}
                        <button class="btn btn-primary" disabled><i class="fa  fa-clock"></i> Délibérer</button>
                    {% else %}
                    <button class="btn btn-primary" data-toggle="modal" data-target="#deliberation"><i class="fa  fa-clock"></i> Délibérer</button>
                    {% endif %}
                    {% include 'EspaceEnseignant/modal_deliberation.html' %}
                    <a href="{% url 'EspaceEnseignant:resultat_ue_pdf' Ue.id %}" target="_blank" class="btn btn-primary"><i class="fa fa-print"></i> Résultat UE</a><!--onclick="generatePDF()"-->
                    {% include 'EspaceEnseignant/modal.html' %}{% include 'EspaceEnseignant/modal_import_note.html' %}<br/><br/>
                    {% include 'main_app/message.html' %}
                </div>
            </div>
              <!-- DONUT CHART -->
              <div class="card card-secondary">
                <div class="card-header" style="background: #21618C">
                  <h3 class="card-title" >Liste des UEs</h3> &nbsp;&nbsp;
                  <div class="card-tools">
                    <button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-tool" data-card-widget="remove"><i class="fas fa-times"></i></button>
                  </div>
                </div>
                <div class="card-body">
                    <table class="table table-bordered">
                        <thead>
                          <tr>
                            <th style="width:100px;">Code UE</th>
                            <th>Libellé</th>
                            <th>CM</th>
                            <th>TD</th>
                            <th>TP</th>
                            <th>Action</th>
                          </tr>
                        </thead>
                        <tbody>
                          {% for enseignantUe in EnseignantUes %}
                            <tr>
                                <td>{{enseignantUe.ecue.code}}</td>
                                <td class="lue">
                                  <a href="#" style="text-decoration:underline;" data-toggle="modal" data-target="#modal-details">{{enseignantUe.ecue.libelle}}</a>
                                </td>
                                <td>{{enseignantUe.ecue.cm}}</td>
                                <td>{{enseignantUe.ecue.td}}</td>
                                <td>{{enseignantUe.ecue.tp}}</td>
                                <td>
                                  <a class="btn btn-primary text-white" href="{% url 'EspaceEnseignant:add_note_views' enseignantUe.ecue.id %}"><i class="fa fa-plus"></i> Noter</a>
                                </td>
                            </tr>
                          {% empty %}
                            <tr>
                                <td colspan="2">Aucune unit&eacute d'enseignement vous est attribu&eacutee</td>
                            </tr>
                          {% endfor %}
                        </tbody>
                    </table>
                </div>
                <!-- /.card-body -->
              </div>
              <!-- /.card -->
        </div>

            
    </div>
  </section>

{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}