{% extends 'other_admin/custom_admin_base.html' %}
{% load static %}
{% block m-title %}Gestion des Comptes > Etudiant{% 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 APPRENANT</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" disabled>
                                <option value="{{ ufr.id }}">{{ ufr.libelle }}</option>
                                {% for ufr in ufrs %}
                                <option value="{{ ufr.id }}">{{ ufr.libelle }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="form-group">
                            <label>NCE</label>
                            <input type="text" class="form-control" name="nce" value="{{ etudiant.nce}}" />
                        </div>
                        <div class="form-group">
                            <label>Nom</label>
                            <input type="text" class="form-control" name="nom" value="{{ etudiant.nom}}" />
                        </div>
                        <div class="form-group">
                            <label>Prénoms</label>
                            <input type="text" class="form-control" name="prenoms" value="{{ etudiant.prenoms}}" />
                        </div>
                        <div class="form-group">
                            <label>Sexe</label>
                            <select class="form-control" name="sexe">
                                <option value="{{ etudiant.sexe }}" selected>{{ etudiant.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="{{ etudiant.datenaiss |date:'Y-m-d' }}" />
                        </div>
                        <div class="form-group">
                            <label>Lieu de naissance</label>
                            <input type="text" class="form-control" name="lieunaiss" value="{{ etudiant.lieunaiss}}" />
                        </div>
                        <div class="form-group">
                            <label>Telephone</label>
                            <input type="text" class="form-control" name="phone" value="{{ etudiant.phone}}" />
                        </div>
                        <div class="form-group">
                            <label>Rôle</label>
                            {% render_field form.role class="form-control" %}
                        </div><hr/>
                        <div class="form-group">
                            <label>Email</label>
                            <input type="text" class="form-control" name="email" value="{{ etudiant.email}}" />
                        </div>
                        <div class="form-group">
                            <label>Mot de Passe</label>
                            <input type="password" class="form-control" placeholder="**********" disabled />
                        </div>

                        <div class="modal-footer">
                        <a href="{% url 'BasicData:etudiant_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 %}