styling order list page

This commit is contained in:
Thomas Steen Rasmussen 2016-05-29 15:16:29 +02:00
parent d55de77201
commit 93fed32cad
2 changed files with 10 additions and 3 deletions

View file

@ -22,9 +22,9 @@
<td>{{ order.id }}</td>
<td>{{ order.get_number_of_items }}</td>
<td>{{ order.total|currency }}</td>
<td>{{ order.open }}</td>
<td>{{ order.paid }}</td>
<td>{{ order.handed_out_status }}</td>
<td class="text-center">{{ order.open|truefalseicon }}</td>
<td class="text-center">{{ order.paid|truefalseicon }}</td>
<td class="text-center">{{ order.handed_out_status }}</td>
<td>
{% url 'shop:order_detail' pk=order.pk as order_detail_url %}
{% bootstrap_button "Order details" icon="th-list" href=order_detail_url button_class="btn-primary btn-sm" %}

View file

@ -8,3 +8,10 @@ def currency(value):
return "{0:.2f} DKK".format(value)
@register.filter(is_safe=True)
def truefalseicon(value):
if value:
return "<span class='text-success'>{% bootstrap_icon 'ok' %}</span>"
else:
return "<span class='text-danger'>{% bootstrap_icon 'remove' %}</span>"