{% extends 'dg_ufr/base_ufr.html' %}
{% load static %}
{% block m-title %} Attribuer une matière{% endblock m-title %}
{% load widget_tweaks %}
{% 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;text-transform:uppercase;"><h3 class="card-title">Attribuer une matière à un Enseignant</h3></div>
                <div class="card-body login-card-body">
                    <div class="row">
                        <div class="col-md-12">
                           <h3><u>Enseignant</u>: {{enseignant.nom}} {{enseignant.prenoms}} </h3><br/><hr/>
                        </div>
                    </div>
                        <form action="#" method="POST" {% if show_form == "show" %}{% else %} hidden {% endif %} >
                            {% csrf_token %}
                            <div class="form-group">
                                <label>Année </label>
                                <select name="annee" class="form-control">
                                    {% for annee in annees %}
                                    <option value="{{ annee.id }}">{{ annee.libelle }}</option>
                                    {% endfor %}
                                </select>
                                <span style="color:red;">{{ form.annee.errors }}</span>
                            </div>
                            <div class="form-group">
                                <label>Matières</label>
                                <select name="ecue" class="form-control">
                                    <option value="choose">---------------------------</option>
                                    {% for Ecue in Ecues %}
                                    <option value="{{ Ecue.id }}">{{ Ecue.ue.niveau }} | {{ Ecue.code }} - {{ Ecue.libelle }} </option>
                                    {% endfor %}
                                </select>
                                <span style="color:red;">{{ form.ecue.errors }}</span>
                            </div><br/>
                        <a href="{% url 'EspaceEnseignant:ufr_home' %}" type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</a>
                        <button type="submit" class='btn btn-primary'>Enregistrer</button>
                        </form>
                        <center><div {% if show_form == "show" %}hidden{% else %}{% endif %}>
                        <a href="{% url 'EspaceEnseignant:ufr_home' %}" type="button" class="btn btn-secondary" data-dismiss="modal">Retour</a>
                        <a href="{% url 'EspaceEnseignant:add_ecue' enseignant.id %}" type="button" class="btn btn-primary" data-dismiss="modal">Attribuée une autre ECUE</a>
                        </div></center>

                    </div>
            </div>
              <!-- DONUT CHART --><!-- /.card -->

        </div>

            
    </div>
  </section>

{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}