{% extends 'dg_ufr/base_ufr.html' %}
{% load static %}
{% block m-title %} Programmer un cours{% 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">Programmer un cours</h3></div>
                <div class="card-body login-card-body">
                    <div class="row">
                        <div class="col-md-12">
                           <h3><u>Matière</u>: ({{ecue.code}}) {{ecue.libelle}} </h3><br/><hr/>
                        </div>
                    </div>
                        <form action="#" method="POST" {% if show_form == "show" %}{% else %} hidden {% endif %} >
                            {% csrf_token %}
                            <div class="row">
                                <div class="col-md-2">
                                        <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="col">
                                    <label>Matière</label>
                                    <select name="ecue" class="form-control">
                                        <option value="{{ ecue.id }}" style="text-transform:uppercase;">{{ ecue }}</option>
                                    </select>
                                </div>
                                <div class="col-md-2">
                                    <label>Niveau</label>
                                    <select name="niveau" class="form-control">
                                        {% for niveau in niveaux %}
                                        {% if  ecue.ue.niveau == niveau %}
                                        <option value="{{ niveau.id }}">{{ niveau }}</option>
                                        {% endif %}
                                        {% endfor %}
                                    </select>
                                </div>
                                <div class="col-md-3">
                                    <label>Période de validité </label>
                                    <select name="periode" class="form-control">
                                        {% for periode in validites %}
                                        <option value="{{ periode.id }}">{{ periode.dateDebut|date:'d-m-Y' }} au {{ periode.dateFin|date:'d-m-Y' }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                            </div><br/>

                            <div class="row">

                            </div>
                    <hr/>
                            <div class="row" style="display:flex;flex-direction:row;">
                                <div class="col">
                                    <label>Lundi</label>
                                    <input class="form-control" type="text" name="lundi" placeholder="Ex: 08:00-11:00" />
                                    <select name="type_lun" class="form-control">
                                       {% include 'dg_ufr/parts/edt_type.html' %}
                                    </select>
                                    <select name="mode_lun" class="form-control" hidden>
                                       <!-- <option value="">---Mode--</option>
                                        <option value="En ligne">En ligne</option> -->
                                        <option value="Présentiel">Présentiel</option>
                                    </select>
                                    <input class="form-control" type="text" name="url_lun" placeholder="Ex: https://moncourenlinge.usp" hidden />
                                </div>
                                <div class="col">
                                    <label>Mardi</label>
                                    <input class="form-control" type="text" name="mardi" placeholder="Ex: 08:00-11:00" />
                                    <select name="type_mar" class="form-control">
                                        {% include 'dg_ufr/parts/edt_type.html' %}
                                    </select>
                                    <select name="mode_mar" class="form-control" hidden>
                                        <option value="Présentiel">Présentiel</option>
                                    </select>
                                    <input class="form-control" type="text" name="url_mar" placeholder="Ex: https://moncourenlinge.usp" hidden />
                                </div>
                                <div class="col">
                                    <label>Mercredi</label>
                                    <input class="form-control" type="text" name="mercredi" placeholder="Ex: 08:00-11:00" />
                                    <select name="type_mer" class="form-control">
                                        {% include 'dg_ufr/parts/edt_type.html' %}
                                    </select>
                                    <select name="mode_mer" class="form-control" hidden>
                                        <option value="Présentiel">Présentiel</option>
                                    </select>
                                    <input class="form-control" type="text" name="url_mer" placeholder="Ex: https://moncourenlinge.usp" hidden />
                                </div>
                                <div class="col">
                                    <label>Jeudi</label>
                                    <input class="form-control" type="text" name="jeudi" placeholder="Ex: 08:00-11:00" />
                                    <select name="type_jeu" class="form-control">
                                        {% include 'dg_ufr/parts/edt_type.html' %}
                                    </select>
                                    <select name="mode_jeu" class="form-control" hidden>
                                        <option value="Présentiel">Présentiel</option>
                                    </select>
                                    <input class="form-control" type="text" name="url_jeu" placeholder="Ex: https://moncourenlinge.usp" hidden />
                                </div>
                                <div class="col">
                                    <label>Vendredi</label>
                                    <input class="form-control" type="text" name="vendredi" placeholder="Ex: 08:00-11:00" />
                                    <select name="type_ven" class="form-control">
                                        {% include 'dg_ufr/parts/edt_type.html' %}
                                    </select>
                                    <select name="mode_ven" class="form-control" hidden>
                                        <option value="Présentiel">Présentiel</option>
                                    </select>
                                    <input  class="form-control" type="text" name="url_ven" placeholder="Ex: https://moncourenlinge.usp" hidden/>
                                </div>
                                <div class="col">
                                    <label>Samedi</label>
                                    <input class="form-control" type="text" name="samedi" placeholder="Ex: 08:00-11:00" />
                                    <select name="type_sam" class="form-control">
                                        {% include 'dg_ufr/parts/edt_type.html' %}
                                    </select>
                                    <select name="mode_sam" class="form-control" hidden>
                                        <option value="Présentiel">Présentiel</option>
                                    </select>
                                    <input class="form-control" type="text" name="url_sam" placeholder="Ex: https://moncourenlinge.usp" hidden />
                                </div>
                            </div>
                                <br/>
                        <button type="submit" class='btn btn-primary'>Enregistrer</button>
                        </form>
                        <center><div {% if show_form == "show" %}hidden{% else %}{% endif %}>
                        <a href="{% url 'EspaceEnseignant:emploi_du_temps_add' ecue.id %}" type="button" class="btn btn-primary" data-dismiss="modal">Ajouter un autre programme</a>
                        </div></center>

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

        </div>

            
    </div>
  </section>

{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}