_activity-timeline.html 2.79 KB
Newer Older
1
{% load i18n %}
2
{% load hro %}
3
{% load arrowfilter %}
4 5
<div id="activity-timeline" class="timeline">

6
{% for a in activities %}
7
<div class="activity{% if a.pk == active.pk %} activity-active{%endif%}"
Csók Tamás committed
8
  data-activity-id="{{ a.pk }}" data-activity-code="{{ a.activity_code }}" data-timestamp="{{ a.started|date:"U" }}">
9
  <span class="timeline-icon{% if a.has_failed %} timeline-icon-failed{% endif %}">
10
  <i class="fa {% if not a.finished %}fa-refresh fa-spin {% else %}fa-{{a.icon}}{% endif %}"></i>
11
</span>
12
{% spaceless %}
13
<strong{% if a.result %} title="{{ a.result|get_text:user }}"{% endif %}>
14
  <a href="{{ a.get_absolute_url }}">
15
    {% if a.times > 1 %}({{ a.times }}x){% endif %}
16
    {{ a.readable_name|get_text:user|capfirst }}</a>
17 18 19 20

{% if a.has_percent %}
  - {{ a.percentage }}%
{% endif %}
21
</strong>
Kálmán Viktor committed
22 23 24 25
{% endspaceless %}{% if a.times < 2 %} <span title="{{ a.started }}">{{ a.started|arrowfilter:LANGUAGE_CODE }}</span>{% endif %}{% if a.user %},
  <a class="no-style-link" href="{% url "dashboard.views.profile" username=a.user.username %}">
    {% include "dashboard/_display-name.html" with user=a.user show_org=True %}
  </a>
26
{% endif %}
27 28
{% if a.is_abortable_for_user %}
<form action="{{ a.instance.get_absolute_url }}" method="POST" class="pull-right">
Kálmán Viktor committed
29
  {% csrf_token %}
30
  <input type="hidden" name="abort_operation"/>
Kálmán Viktor committed
31
  <input type="hidden" name="activity" value="{{ a.pk }}"/>
32
  <button class="btn btn-danger btn-xs"><i class="fa fa-bolt"></i> {% trans "Abort" %}</button>
Kálmán Viktor committed
33 34
</form>
{% endif %}
35 36 37
  {% if a.children.count > 0 %}
    <div class="sub-timeline">
      {% for s in a.children.all %}
38 39
      <div data-activity-id="{{ s.pk }}" data-activity-code="{{ s.activity_code }}"
        class="sub-activity{% if s.has_failed %} sub-activity-failed{% endif %}{% if s.pk == active.pk %} sub-activity-active{% endif %}">
40
        <span{% if s.result %} title="{{ s.result|get_text:user }}"{% endif %}>
41
          <a href="{{ s.get_absolute_url }}">
42
              {{ s.readable_name|get_text:user|capfirst }}</a></span> &ndash;
43
        {% if s.finished %}
44 45 46
          <span title="{{ s.finished }}">
            {{ s.finished|arrowfilter:LANGUAGE_CODE }}
          </span>
47
        {% else %}
48
          <i class="fa fa-refresh fa-spin" class="sub-activity-loading-icon"></i>
49
        {% endif %}
50 51 52
        {% if s.has_failed %}
          <div class="label label-danger">{% trans "failed" %}</div>
        {% endif %}
53 54 55 56 57 58
        </div>
      {% endfor %}
    </div>
  {% endif %}
</div>
{% endfor %}
59 60 61 62 63 64
</div>

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