From 291f160a0085ab2f1cb6f6c42593debe1568bb35 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 20 Jun 2021 17:05:31 -0300 Subject: [PATCH] talks: list talks in a table If multiple languages are configured, also display the language in an extra column. --- wafer/talks/templates/wafer.talks/talks.html | 93 ++++++++++++-------- wafer/talks/views.py | 4 + 2 files changed, 61 insertions(+), 36 deletions(-) diff --git a/wafer/talks/templates/wafer.talks/talks.html b/wafer/talks/templates/wafer.talks/talks.html index e1966165..f8410b51 100644 --- a/wafer/talks/templates/wafer.talks/talks.html +++ b/wafer/talks/templates/wafer.talks/talks.html @@ -5,44 +5,65 @@ {% block content %}
{% regroup talk_list by talk_type.name as grouped_talks %} - {% for type, talks in grouped_talks %} - {% if type %} -

{{ type }}

- {% else %} -

{% trans 'Talks' %}

- {% endif %} -
- {% for talk in talks %} -
- {% if not talk.cancelled and not talk.accepted and talk.is_late_submission %} - L - {% endif %} - {% if talk.submitted %} - {{ talk.status }} - {% elif talk.under_consideration %} - {{ talk.status }} - {% elif talk.reject %} - {{ talk.status }} - {% elif talk.cancelled %} - {{ talk.status }} - {% elif talk.provisional %} - {{ talk.status }} - {% endif %} - {% reviewed_badge user talk %} - {% if talk.withdrawn %} - {{ talk.title }} - {% else %} - {{ talk.title }} - {% endif %} - {% blocktrans trimmed with authors=talk.get_authors_display_name %} - by {{ authors }} - {% endblocktrans %} -
+
+ + {% for type, talks in grouped_talks %} + + + + {% if languages %}{% endif %} + + + + {% for talk in talks %} + + + {% if languages %} + + {% endif %} + + + {% endfor %} {% empty %} -

{% trans 'No talks accepted yet.' %}

+ + + {% endfor %} - - {% endfor %} +
+ {% if type %} + {{ type }} + {% else %} + {% trans "Talk" %} + {% endif %} + {% trans "Language" %}{% trans "Speakers" %}
+ {% if not talk.cancelled and not talk.accepted and talk.is_late_submission %} + L + {% endif %} + {% if talk.submitted %} + {{ talk.status }} + {% elif talk.under_consideration %} + {{ talk.status }} + {% elif talk.reject %} + {{ talk.status }} + {% elif talk.cancelled %} + {{ talk.status }} + {% elif talk.provisional %} + {{ talk.status }} + {% endif %} + {% reviewed_badge user talk %} + {% if talk.withdrawn %} + {{ talk.title }} + {% else %} + {{ talk.title }} + {% endif %} + {{ talk.get_language_display }} + {% with authors=talk.get_authors_display_name %} + {{ authors }} + {% endwith %} +
+ {% trans 'No talks accepted yet.' %} +
+
{% if is_paginated %}
diff --git a/wafer/talks/views.py b/wafer/talks/views.py index b3f0bff1..219ae239 100644 --- a/wafer/talks/views.py +++ b/wafer/talks/views.py @@ -57,6 +57,10 @@ def get_queryset(self): "talk_type", "corresponding_author", "authors", "authors__userprofile" ) + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context["languages"] = Talk.LANGUAGES + return context class TalkView(BuildableDetailView):