_activity-timeline.html 2.19 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
  {% if user.is_superuser %}<a href="{{ a.get_absolute_url }}">{% endif %}
9
    {% if a.times > 1 %}({{ a.times }}x){% endif %}
10
    {{ a.get_readable_name }}{% if user.is_superuser %}</a>{% endif %}
11 12 13 14

{% if a.has_percent %}
  - {{ a.percentage }}%
{% endif %}
15
</strong>
16
{% if a.times < 2%}{{ a.started|date:"Y-m-d H:i" }}{% endif %}{% if a.user %}, 
17
  <a class="no-style-link" href="{% url "dashboard.views.profile" username=a.user.username %}">
18 19
    {% include "dashboard/_display-name.html" with user=a.user show_org=True %}
  </a>
20
{% endif %}
21 22
{% if a.is_abortable_for_user %}
<form action="{{ a.instance.get_absolute_url }}" method="POST" class="pull-right">
Kálmán Viktor committed
23
  {% csrf_token %}
24
  <input type="hidden" name="abort_operation"/>
Kálmán Viktor committed
25
  <input type="hidden" name="activity" value="{{ a.pk }}"/>
26
  <button class="btn btn-danger btn-xs"><i class="icon-bolt"></i> {% trans "Abort" %}</button>
Kálmán Viktor committed
27 28
</form>
{% endif %}
29 30 31
  {% if a.children.count > 0 %}
    <div class="sub-timeline">
      {% for s in a.children.all %}
32
      <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 %}">
33
        <span{% if user.is_superuser and s.result %} title="{{ s.result }}"{% endif %}>
34 35
          {% if user.is_superuser %}<a href="{{ s.get_absolute_url }}">{% endif %}
              {{ s.get_readable_name }}{% if user.is_superuser %}</a>{% endif %}</span> &ndash;
36 37 38 39 40
        {% if s.finished %}
          {{ s.finished|time:"H:i:s" }}
        {% else %}
          <i class="icon-refresh icon-spin" class="sub-activity-loading-icon"></i>
        {% endif %}
41 42 43
        {% if s.has_failed %}
          <div class="label label-danger">{% trans "failed" %}</div>
        {% endif %}
44 45 46 47 48 49
        </div>
      {% endfor %}
    </div>
  {% endif %}
</div>
{% endfor %}