Skip to content
Snippets Groups Projects
Commit 58301524 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Display list of next AKs on slides

parent 8fa36c56
No related branches found
No related tags found
No related merge requests found
......@@ -28,11 +28,11 @@
\end{frame}
{%for category in categories %}
{%for category, ak_list in categories_with_aks %}
\section{ {{- category.name | latex_escape_utf8 -}} }
{% for ak in category.ak_set.all() %}
{% for ak, next_aks in ak_list %}
{% if not ak.wish %}
......@@ -51,7 +51,15 @@
\faScroll
{% endif %}
{{ ak.description | truncatechars(500) | latex_escape_utf8 }}
{{ ak.description | truncatechars(400) | latex_escape_utf8 }}
\vspace{2em}
\begin{scriptsize}
{% for n_ak in next_aks %}
{% if n_ak %}\hfill \faAngleDoubleRight~ {{- n_ak.name | latex_escape_utf8 -}}{% endif %}
{% endfor %}
\end{scriptsize}
\end{frame}
......@@ -64,7 +72,7 @@
\section{ {{- translations.wishes -}} }
{% for ak in wishes %}
{% for ak, next_aks in wishes %}
%\setbeamertemplate{frame footer}{}
......@@ -79,7 +87,15 @@
\faClock~
{{ ak.description | truncatechars(500) | latex_escape_utf8 }}
{{ ak.description | truncatechars(400) | latex_escape_utf8 }}
\vspace{2em}
\begin{scriptsize}
{% for n_ak in next_aks %}
{% if n_ak %}\hfill \faAngleDoubleRight~ {{- n_ak.name | latex_escape_utf8 -}}{% endif %}
{% endfor %}
\end{scriptsize}
\end{frame}
......
from itertools import zip_longest
from django.contrib import admin, messages
from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponseRedirect
......@@ -296,6 +298,8 @@ def export_slides(request, event_slug):
event = get_object_or_404(Event, slug=event_slug)
NEXT_AK_LIST_LENGTH = 4
translations = {
'symbols': _("Symbols"),
'who': _("Who?"),
......@@ -305,11 +309,27 @@ def export_slides(request, event_slug):
'wishes': _("Wishes"),
}
def build_ak_list_with_next_aks(ak_list):
next_aks_list = zip_longest(*[ak_list[i + 1:] for i in range(NEXT_AK_LIST_LENGTH)], fillvalue=None)
return [(ak, next_aks) for ak, next_aks in zip_longest(ak_list, next_aks_list, fillvalue=list())]
categories = event.akcategory_set.all()
categories_with_aks = []
ak_wishes = []
for category in categories:
ak_list = []
for ak in category.ak_set.all(): # order_by("owners").distinct():
if ak.wish:
ak_wishes.append(ak)
else:
ak_list.append(ak)
categories_with_aks.append((category, build_ak_list_with_next_aks(ak_list)))
context = {
'title': event.name,
'categories': event.akcategory_set.all(),
'categories_with_aks': categories_with_aks,
'subtitle': _("AKs"),
"wishes": [ak for ak in event.ak_set.order_by('category') if ak.wish],
"wishes": build_ak_list_with_next_aks(ak_wishes),
"translations": translations,
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment