_activity-timeline.html 1.2 KB
Newer Older
1
{% load i18n %}
2 3
{% for a in activities %}
<div class="activity" data-activity-id="{{ a.pk }}">
4
  <span class="timeline-icon{% if a.has_failed %} timeline-icon-failed{% endif %}">
5 6
  <i class="{% if not a.finished %} icon-refresh icon-spin {% else %}icon-plus{% endif %}"></i>
</span> 
7 8 9
<strong{% if user.is_superuser and a.result %} title="{{ a.result }}"{% endif %}>
    {{ a.get_readable_name }}
</strong>
10
{{ a.started|date:"Y-m-d H:i" }}{% if a.user %}, {{ a.user }}{% endif %}
11 12 13
  {% if a.children.count > 0 %}
    <div class="sub-timeline">
      {% for s in a.children.all %}
14
      <div data-activity-id="{{ s.pk }}" class="sub-activity{% if s.has_failed %} sub-activity-failed{% endif %}">
15
        <span{% if user.is_superuser and s.result %} title="{{ s.result }}"{% endif %}>
16
              {{ s.get_readable_name }}</span> &ndash;
17 18 19 20 21
        {% if s.finished %}
          {{ s.finished|time:"H:i:s" }}
        {% else %}
          <i class="icon-refresh icon-spin" class="sub-activity-loading-icon"></i>
        {% endif %}
22 23 24
        {% if s.has_failed %}
          <div class="label label-danger">{% trans "failed" %}</div>
        {% endif %}
25 26 27 28 29 30
        </div>
      {% endfor %}
    </div>
  {% endif %}
</div>
{% endfor %}