From 32f4c1acaa4ea90352762fb925f80f0ae5186305 Mon Sep 17 00:00:00 2001 From: michigg Date: Mon, 16 Oct 2017 17:52:32 +0200 Subject: [PATCH] fixed happy hour bug --- ofu_app/templates/food/daily_food.jinja | 22 +------------------ ofu_app/templates/food/weekly_food.jinja | 23 +------------------- ofu_app/templates/macros/food_macros.jinja | 25 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 43 deletions(-) diff --git a/ofu_app/templates/food/daily_food.jinja b/ofu_app/templates/food/daily_food.jinja index b9486f2..74ec953 100644 --- a/ofu_app/templates/food/daily_food.jinja +++ b/ofu_app/templates/food/daily_food.jinja @@ -15,27 +15,7 @@ {{ macros.day_menu(title='Markusplatz', location_menu=markus_cafete, fail_text='Aktuell gibt es keine warmen Speisen') }}
-
-
-

Happy Hour Guide von Feki.de

- {% if happy_hours %} -
-
Location
-
Time
-
Description
- {% for happy_hour in happy_hours %} -
-
{{ happy_hour.location }}
-
{{ happy_hour.starttime.strftime('%H:%M') }} - {{ happy_hour.endtime.strftime('%H:%M') }}
-
{{ happy_hour.description }}
-
- {% endfor %} -
- {% else %} -

Leider gibt es heute keine Happy Hours :(

- {% endif %} -
-
+ {{ macros.happy_hours(happy_hours=happy_hours) }}
diff --git a/ofu_app/templates/food/weekly_food.jinja b/ofu_app/templates/food/weekly_food.jinja index 27ff583..99ff620 100644 --- a/ofu_app/templates/food/weekly_food.jinja +++ b/ofu_app/templates/food/weekly_food.jinja @@ -15,28 +15,7 @@ {{ macros.week_menu(title='Markusplatz', location_menus=markus_cafete, fail_text='Aktuell gibt es keine warmen Speisen') }}
-
-
-

Happy Hour Guide von Feki.de

- {% if happy_hours %} -
-
Location
-
Time
-
Description
- {% for happy_hour in happy_hours %} -
-
{{ happy_hour.location }}
-
{{ happy_hour.starttime.strftime('%H:%M') }} - {{ happy_hour.endtime.strftime('%H:%M') }}
-
{{ happy_hour.description }}
-
- {% endfor %} -
- {% else %} -

Leider gibt es heute keine Happy Hours :(

- {% endif %} -
-
+ {{ macros.happy_hours(happy_hours=happy_hours) }}
- {% endblock %} \ No newline at end of file diff --git a/ofu_app/templates/macros/food_macros.jinja b/ofu_app/templates/macros/food_macros.jinja index 26b2d68..90e566f 100644 --- a/ofu_app/templates/macros/food_macros.jinja +++ b/ofu_app/templates/macros/food_macros.jinja @@ -34,4 +34,29 @@
  • {{ single_food.name }}

  • {% endfor %} +{% endmacro %} + +{% macro happy_hours(happy_hours) %} +
    +
    +

    Happy Hours von Feki.de

    + {% if happy_hours %} +
    +
    Location
    +
    Time
    +
    Description
    +
    + {% for happy_hour in happy_hours %} +
    +
    {{ happy_hour.location }}
    +
    {{ happy_hour.starttime.strftime('%H:%M') }} + - {{ happy_hour.endtime.strftime('%H:%M') }}
    +
    {{ happy_hour.description }}
    +
    + {% endfor %} +
    + {% else %} +

    Leider gibt es heute keine Happy Hours :(

    + {% endif %} +
    {% endmacro %} \ No newline at end of file