|
@@ -1,18 +1,30 @@
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
-{% load bootstrap3 %}
|
|
|
+{% load bootstrap3 djadhere services %}
|
|
|
|
|
|
{% block servicestab %} class="active"{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
|
+<div class="well">
|
|
|
+ {% if object_list %}
|
|
|
+ <h3>Mes services</h3>
|
|
|
+ <p>Services actifs : {{ object_list|active|count }}</p>
|
|
|
+ <p>Services inactifs : {{ object_list|inactive|count }}</p>
|
|
|
+ {% else %}
|
|
|
+ <h3>Vous n’avez aucun service :-(</h3>
|
|
|
+ {% endif %}
|
|
|
+</div>
|
|
|
+
|
|
|
+{% for service in object_list %}
|
|
|
+{% if forloop.first %}
|
|
|
<div class="list-group">
|
|
|
- {% for service in object_list %}
|
|
|
- <div class="list-group-item {% if service.is_ongoing %}list-group-item-success{% else %}list-group-item-danger{% endif %}">
|
|
|
+{% endif %}
|
|
|
+ <a href="{% url 'service-detail' service.pk %}" class="list-group-item {% if service.is_ongoing %}list-group-item-success{% else %}list-group-item-danger{% endif %}">
|
|
|
<h4 class="list-group-item-heading">
|
|
|
- #{{ service.pk }} <b>{{ service.service_type }}</b> {{ service.label }}
|
|
|
+ <b>{{ service.service_type }}</b> {{ service.label }}
|
|
|
</h4>
|
|
|
<p class="list-group-item-text">
|
|
|
- {{ service.start|default:"depuis toujours" }} – {{ service.end|default:"présent" }}
|
|
|
+ {{ service.start|default:"…" }} – {{ service.end|default:"…" }}
|
|
|
</p>
|
|
|
{% if service.contribution.count == 1 %}
|
|
|
<p class="list-group-item-text">
|
|
@@ -26,9 +38,9 @@
|
|
|
<p class="list-group-item-text">
|
|
|
{{ service.ip_resources.all|join:", " }}
|
|
|
</p>
|
|
|
- </div>
|
|
|
- {% empty %}
|
|
|
- <div class="list-group-item">Vous n’avez aucun service.</div>
|
|
|
- {% endfor %}
|
|
|
+ </a>
|
|
|
+{% if forloop.last %}
|
|
|
</div>
|
|
|
+{% endif %}
|
|
|
+{% endfor %}
|
|
|
{% endblock %}
|