From e57291914c8afde91ca23b45f0b082f66e580baf Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 22 Jan 2021 15:35:26 +0100 Subject: [PATCH] Item list: Add more icons --- .../templates/pretixcontrol/items/index.html | 19 +++++++++++++++++-- src/pretix/control/views/item.py | 6 ++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/pretix/control/templates/pretixcontrol/items/index.html b/src/pretix/control/templates/pretixcontrol/items/index.html index 4d73d0e8b..ec00e86d6 100644 --- a/src/pretix/control/templates/pretixcontrol/items/index.html +++ b/src/pretix/control/templates/pretixcontrol/items/index.html @@ -31,7 +31,7 @@ {% trans "Product name" %} - + @@ -51,7 +51,17 @@ {% url "control:event.item" organizer=request.event.organizer.slug event=request.event.slug item=i.id %}">{{ i }} {% if not i.active %}{% endif %} -
#{{ i.pk }} +
+ + #{{ i.pk }} + {% for k, c in sales_channels.items %} + {% if k in i.sales_channels %} + + {% else %} + {% endif %} + {% endfor %} + {% if i.available_from or i.available_until %} @@ -70,6 +80,8 @@ {% if i.admission %} + {% elif i.issue_giftcard %} + {% endif %} @@ -81,6 +93,9 @@ {% if i.category.is_addon %} + {% elif i.require_bundling %} + {% elif i.hide_without_voucher %} diff --git a/src/pretix/control/views/item.py b/src/pretix/control/views/item.py index 0406cc490..51c653b9f 100644 --- a/src/pretix/control/views/item.py +++ b/src/pretix/control/views/item.py @@ -47,6 +47,7 @@ from pretix.control.signals import item_forms, item_formsets from pretix.helpers.models import modelcopy from . import ChartContainingView, CreateView, PaginationMixin, UpdateView +from ...base.channels import get_all_sales_channels class ItemList(ListView): @@ -66,6 +67,11 @@ class ItemList(ListView): 'category__position', 'category', 'position' ) + def get_context_data(self, **kwargs): + ctx = super().get_context_data(**kwargs) + ctx['sales_channels'] = get_all_sales_channels() + return ctx + def item_move(request, item, up=True): """