From 71d2818aa878be870ffbdf74344acc2ffbe9391d Mon Sep 17 00:00:00 2001 From: michigg Date: Fri, 27 Oct 2017 01:37:37 +0200 Subject: [PATCH] disable food detailed link if no price defined --- ofu_app/ofu_app/settings.py | 8 ++++---- ofu_app/templates/macros/food_macros.jinja | 13 +++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ofu_app/ofu_app/settings.py b/ofu_app/ofu_app/settings.py index 9594848..0f548c2 100644 --- a/ofu_app/ofu_app/settings.py +++ b/ofu_app/ofu_app/settings.py @@ -147,10 +147,10 @@ TIME_FORMAT = "H:i" # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/' -STATIC_ROOT = os.path.join(BASE_DIR, "static") -# STATICFILES_DIRS = [ -# os.path.join(BASE_DIR, "static"), -# ] +# STATIC_ROOT = os.path.join(BASE_DIR, "static") +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, "static"), +] # Setup support for proxy headers USE_X_FORWARDED_HOST = True diff --git a/ofu_app/templates/macros/food_macros.jinja b/ofu_app/templates/macros/food_macros.jinja index 5930817..388165a 100644 --- a/ofu_app/templates/macros/food_macros.jinja +++ b/ofu_app/templates/macros/food_macros.jinja @@ -35,8 +35,17 @@ {% for single_food in menu %}
  • - -
    {{ single_food.price_student}}
    +
    + {% if single_food.price_student %} + +

    {{ single_food.name }}

    + {% else %} +

    {{ single_food.name }}

    + {% endif %} +
    + {% if single_food.price_student %} +
    {{ single_food.price_student }}
    + {% endif %} {#
    #}