From 5a7e7fbde344675648907ec67bbb5fcf9ae72145 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 10 Mar 2026 09:56:29 +0100 Subject: [PATCH] Event lists: Show sales channels (Z#23225483) (#5967) --- .../templates/pretixcontrol/events/index.html | 17 +++++++++++ .../pretixcontrol/organizers/detail.html | 30 ++++++++++++++++--- src/pretix/control/views/main.py | 7 ++++- src/pretix/control/views/organizer.py | 2 ++ 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/pretix/control/templates/pretixcontrol/events/index.html b/src/pretix/control/templates/pretixcontrol/events/index.html index ae09794abb..4ef033f7f0 100644 --- a/src/pretix/control/templates/pretixcontrol/events/index.html +++ b/src/pretix/control/templates/pretixcontrol/events/index.html @@ -2,6 +2,7 @@ {% load i18n %} {% load urlreplace %} {% load bootstrap3 %} +{% load static %} {% block title %}{% trans "Events" %}{% endblock %} {% block content %}

{% trans "Events" %}

@@ -74,6 +75,7 @@ {% endif %} + {% trans "Sales channels" %} {% trans "Start date" %} @@ -108,6 +110,21 @@ {% endfor %} {% if not hide_orga %}{{ e.organizer }}{% endif %} + + {% for c in e.organizer.sales_channels.all %} + {% if e.all_sales_channels or c in e.limit_sales_channels.all %} + {% if "." in c.icon %} + + {% else %} + + {% endif %} + {% else %} + + {% endif %} + {% endfor %} + {% if e.has_subevents %} diff --git a/src/pretix/control/templates/pretixcontrol/organizers/detail.html b/src/pretix/control/templates/pretixcontrol/organizers/detail.html index 7c2373e72b..a1315c8de1 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/detail.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/detail.html @@ -1,6 +1,7 @@ {% extends "pretixcontrol/organizers/base.html" %} {% load i18n %} {% load bootstrap3 %} +{% load static %} {% block inner %}

{% blocktrans with name=request.organizer.name %}Organizer: {{ name }}{% endblocktrans %} @@ -62,6 +63,7 @@ {% trans "Event name" %} + {% trans "Sales channels" %} {% trans "Start date" %} / @@ -77,10 +79,30 @@ {{ e.name }} -
{{ e.slug }} - {% for k, v in e.meta_data.items %} - {% if v %} - · {{ k }}: {{ v }} +
+ + {{ e.slug }} + + + {% for k, v in e.meta_data.items %} + {% if v %} + · {{ k }}: {{ v }} + {% endif %} + {% endfor %} + + + + {% for c in sales_channels %} + {% if e.all_sales_channels or c in e.limit_sales_channels.all %} + {% if "." in c.icon %} + + {% else %} + + {% endif %} + {% else %} + {% endif %} {% endfor %} diff --git a/src/pretix/control/views/main.py b/src/pretix/control/views/main.py index 8f0455818d..e56677b895 100644 --- a/src/pretix/control/views/main.py +++ b/src/pretix/control/views/main.py @@ -67,7 +67,12 @@ class EventList(PaginationMixin, ListView): def get_queryset(self): qs = self.request.user.get_events_with_any_permission(self.request).prefetch_related( - 'organizer', '_settings_objects', 'organizer___settings_objects', 'organizer__meta_properties', + 'organizer', + 'organizer__sales_channels', + '_settings_objects', + 'organizer___settings_objects', + 'organizer__meta_properties', + 'limit_sales_channels', Prefetch( 'meta_values', EventMetaValue.objects.select_related('property'), diff --git a/src/pretix/control/views/organizer.py b/src/pretix/control/views/organizer.py index 94c77812c4..6ff0d80706 100644 --- a/src/pretix/control/views/organizer.py +++ b/src/pretix/control/views/organizer.py @@ -207,6 +207,7 @@ class OrganizerDetail(OrganizerDetailViewMixin, OrganizerPermissionRequiredMixin 'organizer').prefetch_related( 'organizer', '_settings_objects', 'organizer___settings_objects', 'organizer__meta_properties', + 'limit_sales_channels', Prefetch( 'meta_values', EventMetaValue.objects.select_related('property'), @@ -237,6 +238,7 @@ class OrganizerDetail(OrganizerDetailViewMixin, OrganizerPermissionRequiredMixin self.filter_form['meta_{}'.format(p.name)] for p in self.organizer.meta_properties.filter(filter_allowed=True) ] + ctx['sales_channels'] = self.request.organizer.sales_channels.all() return ctx