_activity-timeline.html 1.96 KB
Newer Older
1
{% load i18n %}
2
{% load hro %}
3
{% load arrowfilter %}
4
<div id="activity-timeline" class="timeline">
5 6 7
  {% for a in activities %}
    <div class="activity" data-activity-id="{{ a.pk }}">
      <span class="timeline-icon{% if a.has_failed %} timeline-icon-failed{% endif %}">
8
        <i class="fa {% if not a.finished %}fa-refresh fa-spin {% else %}fa-{{a.icon}}{% endif %}"></i>
9 10
      </span>
      <strong title="{{ a.result.get_admin_text }}">
11 12
        <a href="{{ a.get_absolute_url }}">
          {{ a.readable_name.get_admin_text|capfirst }}</a>
13
      </strong>
Kálmán Viktor committed
14

15 16
    <span title="{{ a.started }}">{{ a.started|arrowfilter:LANGUAGE_CODE }}</span>{% if a.user %}, {{ a.user }}{% endif %}

17 18 19 20 21 22
    {% if a.children.count > 0 %}
      <div class="sub-timeline">
        {% for s in a.children.all %}
          <div data-activity-id="{{ s.pk }}"
               class="sub-activity{% if s.has_failed %} sub-activity-failed{% endif %}">
            <span title="{{ s.result.get_admin_text }}">
23 24
              <a href="{{ s.get_absolute_url }}">
                {{ s.readable_name|get_text:user }}</a>
25 26 27
            </span>
            &ndash;
            {% if s.finished %}
28 29 30
              <span title="{{ s.finished }}">
                {{ s.finished|arrowfilter:LANGUAGE_CODE }}
              </span>
31 32 33 34 35 36 37 38 39 40
            {% else %}
              <i class="fa fa-refresh fa-spin" class="sub-activity-loading-icon"></i>
            {% endif %}
            {% if s.has_failed %}
              <div class="label label-danger">{% trans "failed" %}</div>
            {% endif %}
          </div>
        {% endfor %}
      </div>
    {% endif %}
41 42
</div>
{% endfor %}
43
</div>
44 45 46 47 48 49 50 51 52 53 54 55

{% if show_show_all %}
<div id="show-all-activities-container">
  <a id="show-all-activities" href="#">
    {% if activities|length > 10 %}
      {% trans "Show less activities" %} <i class="fa fa-angle-double-up"></i>
    {% else %}
      {% trans "Show all activities" %} <i class="fa fa-angle-double-down"></i>
    {% endif %}
  </a>
</div>
{% endif %}