_activity-timeline.html 1.87 KB
Newer Older
1
{% load i18n %}
2
{% for a in activities %}
3
<div class="activity{% if a.pk == active.pk %} activity-active{%endif%}" 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
<strong{% if user.is_superuser and a.result %} title="{{ a.result }}"{% endif %}>
8 9
  {% if user.is_superuser %}<a href="{{ a.get_absolute_url }}">{% endif %}
    {{ a.get_readable_name }}{% if user.is_superuser %}</a>{% endif %}
10
</strong>
11
{{ a.started|date:"Y-m-d H:i" }}{% if a.user %}, {{ a.user }}{% endif %}
Kálmán Viktor committed
12 13 14
{% if user.is_superuser and a.is_abortable %}
<form action="" method="POST" class="pull-right">
  {% csrf_token %}
15
  <input type="hidden" name="abort_operation"/>
Kálmán Viktor committed
16
  <input type="hidden" name="activity" value="{{ a.pk }}"/>
17
  <button class="btn btn-danger btn-xs"><i class="icon-bolt"></i> {% trans "Abort" %}</button>
Kálmán Viktor committed
18 19
</form>
{% endif %}
20 21 22
  {% if a.children.count > 0 %}
    <div class="sub-timeline">
      {% for s in a.children.all %}
23
      <div data-activity-id="{{ s.pk }}" class="sub-activity{% if s.has_failed %} sub-activity-failed{% endif %}{% if s.pk == active.pk %} sub-activity-active{% endif %}">
24
        <span{% if user.is_superuser and s.result %} title="{{ s.result }}"{% endif %}>
25 26
          {% if user.is_superuser %}<a href="{{ s.get_absolute_url }}">{% endif %}
              {{ s.get_readable_name }}{% if user.is_superuser %}</a>{% endif %}</span> &ndash;
27 28 29 30 31
        {% if s.finished %}
          {{ s.finished|time:"H:i:s" }}
        {% else %}
          <i class="icon-refresh icon-spin" class="sub-activity-loading-icon"></i>
        {% endif %}
32 33 34
        {% if s.has_failed %}
          <div class="label label-danger">{% trans "failed" %}</div>
        {% endif %}
35 36 37 38 39 40
        </div>
      {% endfor %}
    </div>
  {% endif %}
</div>
{% endfor %}