Add literal ordering of timeline object types

Makes it so that timline items registered at the same moment are
always ordered "start->end", not "end->start".

Signed-off-by: Paul Konstantin Gerke <paulkgerke@craftware.info>
This commit is contained in:
Paul Konstantin Gerke 2022-01-12 09:24:20 +01:00 committed by Christopher Charbonneau Wells
parent bb1e854ab3
commit 847125b1c6
1 changed files with 45 additions and 41 deletions

View File

@ -17,7 +17,10 @@
</h3>
{% if timeline_objects %}
<ul class="timeline m-auto">
{% for object in timeline_objects %}
{% regroup timeline_objects by time as timeline_moments %}
{% for moment_objects in timeline_moments %}
{% for object in moment_objects.list|dictsort:"type" %}
<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>
@ -60,6 +63,7 @@
</div>
</li>
{% endfor %}
{% endfor %}
</ul>
<h3 class="text-center">
{% if date_previous %}