mybuddy/core/templates/timeline/_timeline.html

73 lines
3.3 KiB
HTML
Raw Normal View History

2021-08-29 20:50:22 +00:00
{% load i18n %}
<h3 class="text-center">
{% if date_previous %}
<a class="btn btn-sm btn-default" href="?date={{ date_previous|date:"Y-m-d" }}" aria-label="{% trans "Previous" %}">
2021-08-30 11:29:53 +00:00
<i class="icon-2x icon-angle-circled-left" aria-hidden="true"></i>
2021-08-29 20:50:22 +00:00
<span class="sr-only">{% trans "Previous" %}</span>
</a>
{% endif %}
{{ date|date }}
{% if date_next %}
<a class="btn btn-sm btn-default" href="?date={{ date_next|date:"Y-m-d" }}" aria-label="{% trans "Next" %}">
2021-08-30 11:29:53 +00:00
<i class="icon-2x icon-angle-circled-right" aria-hidden="true"></i>
2021-08-29 20:50:22 +00:00
<span class="sr-only">{% trans "Next" %}</span>
</a>
{% endif %}
</h3>
{% if timeline_objects %}
<ul class="timeline m-auto">
{% for object in timeline_objects %}
<li{% cycle "" ' class="timeline-inverted"' %}>
<div class="timeline-badge {% if object.type == "start" %}bg-success{% elif object.type == "end" %}bg-danger{% else %}bg-info{% endif %}">
<i class="icon-{{ object.model_name }}"></i>
2021-08-29 20:50:22 +00:00
</div>
<div class="card text-right">
<div class="card-body">
{{ object.event }}
{% for detail in object.details %}
<div><small>{{ detail }}</small></div>
{% endfor %}
</div>
<div class="card-footer text-muted">
{% blocktrans trimmed with since=object.time|timesince time=object.time|time %}
{{ since }} ago ({{ time }})
{% endblocktrans %}
{% if object.duration %}
<div>
<small>Duration: {{ object.duration }}</small>
</div>
{% endif %}
{% if object.time_since_prev %}
<div>
<small>{{ object.time_since_prev }} since previous</small>
</div>
{% endif %}
{% if object.edit_link %}
<div>
<small><a href="{{ object.edit_link }}">Edit</a></small>
</div>
{% endif %}
</div>
</div>
</li>
{% endfor %}
</ul>
<h3 class="text-center">
{% if date_previous %}
<a class="btn btn-sm btn-default" href="?date={{ date_previous|date:"Y-m-d" }}" aria-label="{% trans "Previous" %}">
2021-08-30 11:29:53 +00:00
<i class="icon-2x icon-angle-circled-left" aria-hidden="true"></i>
2021-08-29 20:50:22 +00:00
<span class="sr-only">{% trans "Previous" %}</span>
</a>
{% endif %}
{{ date|date }}
{% if date_next %}
<a class="btn btn-sm btn-default" href="?date={{ date_next|date:"Y-m-d" }}" aria-label="{% trans "Next" %}">
2021-08-30 11:29:53 +00:00
<i class="icon-2x icon-angle-circled-right" aria-hidden="true"></i>
2021-08-29 20:50:22 +00:00
<span class="sr-only">{% trans "Next" %}</span>
</a>
{% endif %}
</h3>
{% else %}
<div class="text-center">No events</div>
{% endif %}