Item list: Add more icons

This commit is contained in:
Raphael Michel
2021-01-22 15:35:26 +01:00
parent 7165cc4c3b
commit e57291914c
2 changed files with 23 additions and 2 deletions

View File

@@ -31,7 +31,7 @@
<thead>
<tr>
<th>{% trans "Product name" %}</th>
<th class="iconcol"></th>
<th></th>
<th class="iconcol"></th>
<th class="iconcol"></th>
<th class="iconcol"></th>
@@ -51,7 +51,17 @@
{% url "control:event.item" organizer=request.event.organizer.slug event=request.event.slug item=i.id %}">{{ i }}</a>
{% if not i.active %}</strike>{% endif %}
</strong>
<br><small class="text-muted">#{{ i.pk }}</small>
<br>
<small class="text-muted">
#{{ i.pk }}
{% for k, c in sales_channels.items %}
{% if k in i.sales_channels %}
<span class="fa fa-fw fa-{{ c.icon }} text-muted"
data-toggle="tooltip" title="{% trans c.verbose_name %}"></span>
{% else %}
{% endif %}
{% endfor %}
</small>
</td>
<td>
{% if i.available_from or i.available_until %}
@@ -70,6 +80,8 @@
<td>
{% if i.admission %}
<span class="fa fa-user fa-fw text-muted" data-toggle="tooltip" title="{% trans "Admission ticket" %}"></span>
{% elif i.issue_giftcard %}
<span class="fa fa-gift fa-fw text-muted" data-toggle="tooltip" title="{% trans "Gift card" %}"></span>
{% endif %}
</td>
<td>
@@ -81,6 +93,9 @@
{% if i.category.is_addon %}
<span class="fa fa-puzzle-piece fa-fw text-muted" data-toggle="tooltip"
title="{% trans "Only available as an add-on product" %}"></span>
{% elif i.require_bundling %}
<span class="fa fa-puzzle-piece fa-fw text-muted" data-toggle="tooltip"
title="{% trans "Only available as part of a bundle" %}"></span>
{% elif i.hide_without_voucher %}
<span class="fa fa-tags fa-fw text-muted" data-toggle="tooltip"
title="{% trans "Only visible with a voucher" %}"></span>

View File

@@ -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):
"""