From 9ed10884e282129b6b94ad4611d2fe7dd54c6b73 Mon Sep 17 00:00:00 2001 From: Robert Einsle Date: Sun, 26 Feb 2017 10:32:38 +0100 Subject: [PATCH] carom/carom-doc#6 Anzeige des PReises pro Tisch --- billard/templatetags/display_client.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/billard/templatetags/display_client.py b/billard/templatetags/display_client.py index a5f2d0d..262e865 100644 --- a/billard/templatetags/display_client.py +++ b/billard/templatetags/display_client.py @@ -13,6 +13,7 @@ def display_client(client, desk_no): if len(desks) == 0: return '' desk = desks[0] + loc = desk.client.location if not desk.enabled: return '' alert = 'alert-success' @@ -25,8 +26,8 @@ def display_client(client, desk_no): start=a.time_from, end=datetime.now(), pph=desk.prize, - hh_start=desk.client.location.happy_hour_start, - hh_end=desk.client.location.happy_hour_end, + hh_start=loc.happy_hour_start, + hh_end=loc.happy_hour_end, pphh=desk.prize_hh, ) prize = '{0:.2f}'.format(prize) @@ -35,6 +36,16 @@ def display_client(client, desk_no): html = '
\n' html += '
\n'.format(alert) html += '

({}) {}

\n'.format(desk_no, desk.name) + if loc.happy_hour_start is not None and desk.prize_hh is not None: + html += '
Preis: {:.2f} € / Stunde | {} - {}: {:.2f} / € Stunde\n'\ + .format( + desk.prize, + loc.happy_hour_start, + loc.happy_hour_end, + desk.prize_hh,) + else: + html += '
Preis: {0:.2f} / Stunde\n'.format( + desk.prize,) if len(acc) > 0: html += ' \n' for a in acc: