{% extends 'base.html' %}

{% block top %}
  <p>
    utente che sta effettuando gli aggiornamenti {{ utenteautorizzato.mail }}@{{ utenteautorizzato.domain.nome }}
  </p>
{% endblock %}

{% block body %}
  <form name="causalelist" method="POST">
  <table class='table'>
    <thead>
      <tr>
        <th scope='col'><button class='btn btn-link btn-sm' type='submit' name='Ordine_by_id' value='Ordine_by_id'>#</button></th>
	<th scope='col'><button class='btn btn-link btn-sm' type='submit' name='Ordine_by_causale' value='Ordine_by_causale'>causale</button></th>
	<th scope='col'>Azioni</th>
	<th scope='col'><button class='btn btn-link btn-sm' type='submit' name='Ordine_by_ordine' value='Ordine_by_ordine'>Ord.</button></th>
        <th scope='col'>*</th>
      </tr>
    </thead>
    <tbody>
     {% csrf_token %}
      {% for u in causali %}
        <tr>
          <th scope='row'>{{ u.id }}</th>
	  <td>{{ u.nome }}</td>
	  <td><button class='btn btn-primary' type='submit' value='{{ u.id }}' name='causaleedit'>Edit Causale</button>
	  <td>{{ u.ordine }}</td>
          <td>{% if u.enabled %}*{% else %}-{% endif %}</td>
        </tr>
      {% endfor %}
    </tbody>
    <p>
    <button class='btn btn-primary' type='submit' value='0' name='causaleedit'>Nuova Causale</button>
    </p>
  </form>

{% endblock %}


