{% extends 'base.html' %}
{% load domini_tags %}
{% block top %}
  <p>
    Utente che sta effettuando le operazioni: {{ utenteautorizzato.mail }}@{{ utenteautorizzato.domain.nome }}
  </p>
{% endblock %}

{% block body %}

  <form name='newservice' method='post'>
    {% csrf_token %}
    <button class="btn btn-primary" type="submit" name='Nuovo Servizio' value="Nuovo Servizio">Nuovo Servizio</button>
  </form>

  <table class='table'>
    <thead>
      <tr>
        {% csrf_token %}
	<th scope='col'>Nome</th>
	<th scope='col'>Classe</th>
        <th scope='col'>*</th>
	<th scope='col'>home</th>
	<td scioe='col'>Opt</th>
      </tr>
    </thead>
    <tbody>
      <form name="dominioservice" method="POST">
      {% csrf_token %}
      {% for d in domainservice %}
        <tr>
          <td>{{ d.nome }}</td>
	  <td>{{ d.classe }}</td>
          <td>{% if d.enabled %} * {% else %} - {% endif %}</td>

	  <td><button class="btn btn-primary" type="submit" name='Edit' value="{{ d.id }}" {% if not d.enabled %} disable {% endif %} >Edit</button>
          </td>
          <td><button class="btn btn-primary" type="submit" name='{% if d.enabled %}disable{% else %}enable{% endif %}' value='{{ d.id }}'>
                  {% if d.enabled %}Disabilita{% else %}Abilita{% endif %}</button></td>
              <td>{% if d.tobedeleted %}*{% endif %}</td>
	      <td>
        </tr>
      {% endfor %}
      </form>
    </tbody>
{% endblock %}


