Display a timeline on the dashboard (#1290)

* Timeline data model

* Display timeline

* …

* More events

* Plugin support

* Fix docs typo
This commit is contained in:
Raphael Michel
2019-05-17 17:32:38 +02:00
committed by GitHub
parent ecc9c7f39f
commit c6b18b31a1
8 changed files with 331 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
{% load i18n %}
<div class="panel panel-default items">
<div class="panel-heading">
<h3 class="panel-title">
{% trans "Your timeline" %}
</h3>
</div>
<div class="panel-body timeline">
{% regroup timeline by date as tl_list %}
{% for day in tl_list %}
<div class="row {% if day.grouper < today %}text-muted{% endif %}">
<div class="col-date">
<strong>{{ day.grouper|date:"SHORT_DATE_FORMAT" }}</strong>
</div>
<div class="col-event">
{% for e in day.list %}
<strong class="">{{ e.time|date:"TIME_FORMAT" }}</strong>
&nbsp;
<span class="{% if e.time < nearly_now %}text-muted{% endif %}">
{{ e.entry.description }}
</span>
{% if e.entry.edit_url %}
&nbsp;
<a href="{{ e.entry.edit_url }}" class="text-muted">
<span class="fa fa-edit"></span>
</a>
{% endif %}
{% if forloop.revcounter > 1 %}
<br/>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>

View File

@@ -90,6 +90,9 @@
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
</form>
{% endif %}
{% if not request.event.has_subevents or subevent %}
{% include "pretixcontrol/event/fragment_timeline.html" %}
{% endif %}
<div class="dashboard">
{% for w in widgets %}
<div class="widget-container widget-{{ w.display_size|default:"small" }}">