{% extends 'enseignant/base_profile.html' %}
{% load static %}
{% load widget_tweaks %}
{% load unicorn %}
{% unicorn_scripts %}
{% block custom_css %}
<style>
        #loading {
            background: red;
            position: fixed;
            top: 0;
            width: 100%;
            height: 100%;
        }

    </style>
{% endblock custom_css %}
{% block page_title %}{{page_title}}{% endblock page_title %}
{% block content %}
<section class="content">
    <div class="container-fluid">
        <!-- Small boxes (Stat box)-->
        {% include "enseignant/parts/stats_seance.html" %}

    </div>
  </section>


<div class="card mb-3">
    <div class="card-header">
        <i class="fas fa-table"></i>
        MODIFIER UN SUPPORT
    </div>
    <div class="card-body">
        <form action="#" method="post">
               {% csrf_token %}
                <div class="form-group">
                    <label>Nom de Fichier</label>
                    {% render_field form.libelle class="form-control" placeholder="Nom du fichier" %}
                </div>
                <div class="form-group">
                    <label>Cours</label>
                   <!-- {% render_field form.cours class="form-control" %} -->
                  <select name="cours" class="form-control">
                      <option value="vide">------------</option>
                      {% for cr in cours %}
                      <option value="{{cr.id}}" {% if cr == support.cours %}selected{% endif %}>{{cr}}</option>
                      {% endfor %}
                  </select>
                </div>
              <div class="form-group">
                    <label>Publications</label>
                   <!-- {% render_field form.pub class="form-control" %} -->
                  <select name="pub" class="form-control">
                      <option value="vide">------------</option>
                      {% for pb in publications %}
                      <option value="{{pb.id}}"{% if pb == support.pub %}selected{% endif %}>{{pb}}</option>
                      {% endfor %}
                  </select>
              </div>
              <div class="form-group">
                    <label>Fichier</label>
                    {% render_field form.fichier class="form-control" %}
                </div>

              <div class="modal-footer">
                <button type="submit" class="btn btn-success">Enregistrer</button>
              </div>
          </form>
    </div>
</div>
{% endblock content %}

{% block custom_js %}
<script>
    $('#sField').change(function(){
        $('#sForm').submit()
    });
</script>
{% endblock custom_js %}