service_detail.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% extends 'base.html' %}
  2. {% load bootstrap4 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>
  26. {{ allocation.resource }}
  27. {% if allocation.resource.last_state.get_state_display == 'UP' %}
  28. (UP)
  29. {% elif allocation.resource.last_time_up %}
  30. (dernière réponse au ping : {{ allocation.resource.last_time_up|naturaltime }})
  31. {% endif %}
  32. </li>
  33. {% if forloop.last %}</ul>{% endif %}
  34. {% empty %}
  35. aucune IP allouée
  36. {% endfor %}
  37. </p>
  38. {% if service.ports.exists %}
  39. <p>
  40. Port{{ service.ports.count|pluralize }} :
  41. {% for port in service.ports.all %}
  42. {% if forloop.first %}<ul>{% endif %}
  43. <li>Switch {{ port.switch }} port {{ port.port }}{% if port.up is not None %} ({{ port.up|yesno:"UP,DOWN" }}){% endif %}
  44. {% if forloop.last %}</ul>{% endif %}
  45. {% endfor %}
  46. </p>
  47. {% endif %}
  48. {% if service.service_type.contact %}
  49. <p>En cas de problème, contactez {{ service.service_type.contact }}.</p>
  50. {% endif %}
  51. </div>
  52. </div>
  53. {% endblock %}