{% extends 'other_admin/custom_admin_base.html' %}
{% load static %}
{% block m-title %}Gestion des Comptes > Enseignant{% 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"><h3 class="card-title">EDITER UN ETUDIANT</h3>
                </div>
                <div class="card-body">
                    <form method="post" action="#">
                        {% csrf_token %}

                        <div class="form-group">
                            <label>UFR</label>
                            <select class="form-control" name="ufr">
                                {% for ufr in ufrs %}
                                <option value="{{ ufr.id }}" {% if enseignant.ufr == ufr %}selected{% endif %}>{{ ufr.libelle }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="form-group">
                            <label>Grade</label>
                            <select class="form-control" name="grade">
                                {% for grad in grade %}
                                <option value="{{ grad.id }}" {% if enseignant.grade == grad %}selected{% endif %}>{{ grad.libelle }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="form-group">
                            <label>Nom</label>
                            <input type="text" class="form-control" name="nom" value="{{ enseignant.nom}}" />
                        </div>
                        <div class="form-group">
                            <label>Prénoms</label>
                            <input type="text" class="form-control" name="prenoms" value="{{ enseignant.prenoms}}" />
                        </div>
                        <div class="form-group">
                            <label>Sexe</label>
                            <select class="form-control" name="sexe">
                                <option value="{{ enseignant.sexe }}" selected>{{ enseignant.sexe }}</option>
                                <hr/>
                                <option value="M">M</option>
                                <option value="F">F</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label>Date de Naissance</label>
                            <input type="date" class="form-control" name="datenaiss" value="{{ enseignant.datenaiss |date:'Y-m-d' }}" />
                        </div>
                        <div class="form-group">
                            <label>Lieu de naissance</label>
                            <input type="text" class="form-control" name="lieunaiss" value="{{ enseignant.lieunaiss}}" />
                        </div>
                        <div class="form-group">
                            <label>Telephone</label>
                            <input type="text" class="form-control" name="phone" value="{{ enseignant.phone}}" />
                        </div><hr/>
                        <div class="form-group">
                            <label>Email</label>
                            <input type="text" class="form-control" name="email" value="{{ enseignant.email}}" />
                        </div>
                        <hr/>
                        <div class="form-group">
                            <label>Autorisé à entrer les emplois du temps</label>
                            {% render_field form.add_programme class="form-control"  %}
                        </div>
                        <div class="modal-footer">
                        <a href="{% url 'BasicData:enseignant_list' %}" type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</a>
                        <button type="submit" class="btn btn-primary">Enregistrer</button>
                      </div>
                    </form>

                </div>
            </div>
      </div>
    </div>
</section>

{% endblock content %}

{% block custom_js %}

{% endblock custom_js %}