Add icon columns to product overview

This commit is contained in:
Raphael Michel
2017-11-26 14:19:02 +01:00
parent 40818ae853
commit 8d90c9e03a
3 changed files with 27 additions and 1 deletions

View File

@@ -31,6 +31,9 @@
<thead>
<tr>
<th>{% trans "Product name" %}</th>
<th class="iconcol"></th>
<th class="iconcol"></th>
<th class="iconcol"></th>
<th>{% trans "Category" %}</th>
<th class="action-col-2"></th>
<th class="action-col-2"></th>
@@ -46,7 +49,25 @@
<a href="
{% url "control:event.item" organizer=request.event.organizer.slug event=request.event.slug item=i.id %}">{{ i.name }}</a>
{% if not i.active %}</strike>{% endif %}
</strong></td>
</strong>
</td>
<td>
{% if i.admission %}
<span class="fa fa-user fa-fw text-muted" data-toggle="tooltip" title="{% trans "Admission ticket" %}"></span>
{% endif %}
</td>
<td>
{% if i.var_count %}
<span class="fa fa-list-ul fa-fw text-muted" data-toggle="tooltip" title="{% trans "Product with variations" %}"></span>
{% endif %}
</td>
<td>
{% if i.hide_without_voucher %}
<span class="fa fa-ticket fa-fw text-muted" data-toggle="tooltip" title="{% trans "Only visible with a voucher" %}"></span>
{% elif i.require_voucher %}
<span class="fa fa-ticket fa-fw text-muted" data-toggle="tooltip" title="{% trans "Can only bought using a voucher" %}"></span>
{% endif %}
</td>
<td>{% if i.category %}{{ i.category.name }}{% endif %}</td>
<td>
<a href="{% url "control:event.items.up" organizer=request.event.organizer.slug event=request.event.slug item=i.id %}" class="btn btn-default btn-sm {% if forloop.counter0 == 0 %}disabled{% endif %}"><i class="fa fa-arrow-up"></i></a>

View File

@@ -46,6 +46,8 @@ class ItemList(ListView):
def get_queryset(self):
return Item.objects.filter(
event=self.request.event
).annotate(
var_count=Count('variations')
).prefetch_related("category")

View File

@@ -480,3 +480,6 @@ body.loading #wrapper {
margin-top: 0;
}
}
.iconcol {
width: 1.28571em;
}