{% load static %}
{% if head %}
<tr>
  <th>NOM, Prénom</th>
  <th>Cl. préc.</th>
  <th>Caution</th>
</tr>
{% else %}
<tr>
  <td>
    {{ eleve.NomPrenomEleve }}
    {% if "sans" in eleve.caution_str %}
    <span class="warn">(S.C.)</span>
    {% endif %}
  </td>
  <td>{{ eleve.classes_passees }}</td>
  <td>
    <div style="display:flex; width: 130px;">
      {% if eleve.no_caution >= MIN_NO_CAUTION %}
      <b>{{ eleve.caution_str }}</b>
      {% else %}
      {% if eleve.no_caution == 0 %}
      <input name="no_caution" class="no_caution"
	     placeholder="N° de caution ?" style="width: 100%"
	     onchange="valide_caution(this)"/>
      <button onclick="valide_caution(this)">
	<img alt="valider" title="Valider le numéro de caution"
	     src="{% static '/img/edit-add.svg' %}" style="width: 16px;" />
      </button>
      {% else %}
      N° <input name="no_caution" class="no_caution"
		value="{{ eleve.no_caution }}" disabled
		style="width: calc(100% - 16px);"/>
      {% endif %}
      {% endif %}
    </div>
  </td>
</tr>
{% endif %}
