service_detail.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {% extends 'base.html' %}
  2. {% load bootstrap3 humanize %}
  3. {% block usertab %}{% if service.adhesion == request.user.adhesion %} class="active"{% endif %}{% endblock %}
  4. {% block corptab %}{% if service.adhesion != request.user.adhesion %} active{% endif %}{% endblock %}
  5. {% block content %}
  6. <div class="panel panel-{{ service.is_active|yesno:"success,danger"}}">
  7. <div class="panel-heading">
  8. <h3>{{ service.service_type }}</h3>
  9. {% if service.label %}
  10. <h4>{{ service.label }}</h4>
  11. {% endif %}
  12. </div>
  13. <div class="panel-body">
  14. <p>Identifiant du service : #{{ service.id }}</p>
  15. <p>Responsable : {{ service.adhesion }} {{ service.adhesion.adherent }}</p>
  16. {% if service.contribution.get_current_payment %}
  17. <p>Contribution : {{ service.contribution.get_current_payment }}</p>
  18. {% else %}
  19. <p>Contribution : pas de contribution</p>
  20. {% endif %}
  21. <p>
  22. IP allouée{{ service.active_allocations.count|pluralize }} :
  23. {% for allocation in service.active_allocations.all %}
  24. {% if forloop.first %}<ul>{% endif %}
  25. <li>{{ allocation.resource }}{% if allocation.resource.last_time_up %} (dernière réponse au ping : {{ allocation.resource.last_time_up|naturaltime }}){% endif %}</li>
  26. {% if forloop.last %}</ul>{% endif %}
  27. {% empty %}
  28. aucune IP allouée
  29. {% endfor %}
  30. </p>
  31. {% if service.ports.exists %}
  32. <p>
  33. Port{{ service.ports.count|pluralize }} :
  34. {% for port in service.ports.all %}
  35. {% if forloop.first %}<ul>{% endif %}
  36. <li>Switch {{ port.switch }} port {{ port.port }}{% if port.up is not None %} ({{ port.up|yesno:"UP,DOWN" }}){% endif %}
  37. {% if forloop.last %}</ul>{% endif %}
  38. {% endfor %}
  39. </p>
  40. {% endif %}
  41. </div>
  42. </div>
  43. {% endblock %}