styling order list page
This commit is contained in:
parent
d55de77201
commit
93fed32cad
|
@ -22,9 +22,9 @@
|
||||||
<td>{{ order.id }}</td>
|
<td>{{ order.id }}</td>
|
||||||
<td>{{ order.get_number_of_items }}</td>
|
<td>{{ order.get_number_of_items }}</td>
|
||||||
<td>{{ order.total|currency }}</td>
|
<td>{{ order.total|currency }}</td>
|
||||||
<td>{{ order.open }}</td>
|
<td class="text-center">{{ order.open|truefalseicon }}</td>
|
||||||
<td>{{ order.paid }}</td>
|
<td class="text-center">{{ order.paid|truefalseicon }}</td>
|
||||||
<td>{{ order.handed_out_status }}</td>
|
<td class="text-center">{{ order.handed_out_status }}</td>
|
||||||
<td>
|
<td>
|
||||||
{% url 'shop:order_detail' pk=order.pk as order_detail_url %}
|
{% 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" %}
|
{% bootstrap_button "Order details" icon="th-list" href=order_detail_url button_class="btn-primary btn-sm" %}
|
||||||
|
|
|
@ -8,3 +8,10 @@ def currency(value):
|
||||||
return "{0:.2f} DKK".format(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>"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue