Merge branch 'master' of github.com:bornhack/bornhack-website

This commit is contained in:
Thomas Steen Rasmussen 2017-03-26 15:05:39 +02:00
commit 489cc2f55f
4 changed files with 14 additions and 3 deletions

View file

@ -62,7 +62,8 @@
<td> <td>
<strong>Total</strong> <strong>Total</strong>
<td> <td>
{{ order.total|currency }} {{ order.total|currency }}<br />
(~{{ order.total|approxeur }})
</table> </table>

View file

@ -20,7 +20,8 @@
<h3> <h3>
<small>Price</small><br /> <small>Price</small><br />
{{ product.price|currency }} {{ product.price|currency }}<br />
~{{ product.price|approxeur }}
</h3> </h3>
<hr /> <hr />

View file

@ -57,7 +57,7 @@ Shop | {{ block.super }}
</td> </td>
<td> <td>
<div class="pull-right"> <div class="pull-right">
{{ product.price|currency }} {{ product.price|currency }} (~{{ product.price|approxeur }})
</div> </div>
</td> </td>
</tr> </tr>

View file

@ -13,6 +13,15 @@ def currency(value):
return False return False
@register.filter
def approxeur(value):
print(type(value))
try:
return "{0:.2f} EUR".format(value / Decimal(7.5))
except ValueError:
return False
@register.filter() @register.filter()
def truefalseicon(value): def truefalseicon(value):
if value: if value: