service_list.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {% extends 'base.html' %}
  2. {% load bootstrap3 %}
  3. {% block content %}
  4. <div class="panel panel-primary">
  5. <div class="panel-heading">
  6. <a class="btn btn-success pull-right" href="{% url 'service-add' %}">Ajouter un service</a>
  7. <h1>Services</h1>
  8. </div>
  9. {% for service in object_list %}
  10. {% if forloop.first %}
  11. <table class="table">
  12. <tr>
  13. <th>#</th>
  14. <th>Type</th>
  15. <th>Label</th>
  16. <th>Adhérent</th>
  17. <th></th>
  18. </tr>
  19. {% endif %}
  20. <tr class="{{ service.active|yesno:"success,danger" }}">
  21. <td><a href="{% url 'service-detail' service.pk %}">#{{ service.pk }}</a></td>
  22. <td>{{ service.service_type }}</td>
  23. <td>{{ service.label }}</td>
  24. <td>
  25. <a href="{% url 'adhesion-detail' service.adhesion.id %}">ADT{{ service.adhesion.pk }}</a>
  26. <a href="{{ service.adhesion.get_adherent_detail_url }}">{{ service.adhesion.get_adherent_name }}</a>
  27. </td>
  28. <td class="text-right">
  29. <a href="{% url 'service-edit' service.pk %}"><span class="glyphicon glyphicon-pencil"></span>&nbsp;Modifier</a>
  30. </td>
  31. </tr>
  32. {% if forloop.last %}
  33. </table>
  34. {% endif %}
  35. {% empty %}
  36. <div class="panel-body">
  37. <em>Aucun service.</em>
  38. </div>
  39. {% endfor %}
  40. </div>
  41. {% endblock %}