<!-- Button trigger modal -->
<!-- Modal -->
{% load widget_tweaks %}
<div class="modal fade" id="addsalleSam{{code.id}}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header" style="background: #21618C;color:#fff;">
        <h5 class="modal-title" id="exampleModalLabel">
          <span>{{code.ecue.code}}</span>
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <h6><span style="{% if code.ecue.code in SDM1 %} color:#00BFFF; {% elif code.ecue.code in TES2 %} color:#FFC300; {% elif code.ecue.code in ARHAI3 %} color:#20B2AA; {% elif code.ecue.code in MPSI4 %} color:#FF00FF; {% endif %}">
          <span style="text-transform:uppercase;">{{code.ecue.libelle}}</span></span></h6><hr/>
        <p><strong>Enseignant</strong> : {{code.enseignants}}</p>
        <p><strong>Jour</strong> : Lundi</p>
        <p><strong>Horaire</strong> : {{code.lundi}}</p>
        <p><strong>Type de Cours</strong> : {{code.type_lun}}</p>
        <p><strong>Salle</strong> : {{ code.salle_lun }}</p>
        <hr/>
        <form method="post" action="#">
          {% csrf_token %}
          <div class="form-group">
            <label>Choisir une salle</label>
            <select class="form-control" name="salle">
              {% for salle in salles %}
              <option value="{{salle.id}}">{{salle}}</option>
              {% endfor %}
            </select>
            <input name="Progid" type="text" value="{{code.id}}" hidden/>
            <input name="jour" type="text" value="sam" hidden/>
        </div>
        <!--<p><strong>Salle</strong> : {{ code.salle2_lun.all|join:", " }}</p> -->

            <div class="modal-footer">
            <button type="submit" name="addSalleBtn" class="btn btn-success"><i class="fa fa-save"></i>&nbsp; Enregistrer</button>
            <button class="btn btn-secondary" data-dismiss="modal"> Annuler</button>
          </div>
         </form>
      </div>
    </div>
  </div>
</div>