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

