{% extends 'base.html' %}

{% block body %}
  <form name="azienda" method="POST">
  <table class='table table-striped table-hover'>
    <thead class='thead-dark'>
      <tr>
        <th scope='col'>Azienda</th>
        <th scope='col'>Partita Iva</th>
      </tr>
    </thead>
    <tbody>
      {% csrf_token %}
      {% for az in azienda %}
        <tr>
	  <td> {{ az.nome }} </td>
	  <td> {{ az.partitaita }}</td>
          <td><button type="submit" class='btn btn-primary' name="utenti" value="{{ az.id }}">Utenti</button>
              <button type='submit' class="btn btn-primary" name="documenti" value='{{ az.id }}'>Documenti</button>
         </td>

	</tr>
      {% endfor %} 
    </tbody>
  </table>
    <div>
      <input type='submit' class="btn btn-primary" name="ritorna" value="Logout">
    </td>
  </form>
{% endblock %}

{% block bodybottom %}
    <div><br><br></div>
    <div class='form-outline mb-3 text-center btn-primary h3'>
           Elenco Azioni Registrate
    </div>

    <div>
    <table class='table table-striped table-hover'>
      <thead class='thead-dark'>
      <tr>
        <th scope='col'>Data</th>
        <th scope='col'>Causale</th>
        <th scope='col'>Utente</th>
        <th scope='col'>Amministratore</th>
        <th scope='col'>documento</th>

      </tr>
      </thead>
      <tbody>
        {% for attivita in listaAttivita %}
        <tr>
          <td> {{ attivita.data | date:'d/m/Y H:i' }} </td>
          <td> {{ attivita.causale.nome }} </td>
          <td> {{ attivita.utente.nome }} </td>
          <td> {{ attivita.amministratore.username }}</td>
          <td> {{ attivita.documento.documento }}</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>

{% endblock %}

