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