62 lines
2.3 KiB
Django/Jinja
62 lines
2.3 KiB
Django/Jinja
{% macro day_menu(title, location_menu, fail_text) -%}
|
|
<div class="col p-2">
|
|
<div class="p-3 border border-dark rounded bg-light text-dark">
|
|
<h2>{{ title }}</h2>
|
|
{% if location_menu %}
|
|
<p>{{ location_menu.date.strftime('%d.%m.%Y') }}</p>
|
|
{{ get_menu(location_menu.menu.all()) }}
|
|
{% else %}
|
|
<p> {{ fail_text }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro week_menu(title, location_menus, fail_text) -%}
|
|
<div class="col p-2">
|
|
<div class="p-3 border border-dark rounded bg-light text-dark">
|
|
<h2>{{ title }}</h2>
|
|
{% if location_menus %}
|
|
{% for menu in location_menus %}
|
|
<p><strong>{{ menu.date.strftime('%A.%m.%Y') }}</strong></p>
|
|
{{ get_menu(menu.menu.all()) }}
|
|
{% endfor %}
|
|
{% else %}
|
|
<p> {{ fail_text }}</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro get_menu(menu) -%}
|
|
<ul>
|
|
{% for single_food in menu %}
|
|
<li><p>{{ single_food.name }}</p></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endmacro %}
|
|
|
|
{% macro happy_hours(happy_hours) %}
|
|
<div class="col p-2">
|
|
<div class="p-3 border border-dark rounded bg-light text-dark">
|
|
<h2>Happy Hours <small>von Feki.de</small></h2>
|
|
{% if happy_hours %}
|
|
<div class="row">
|
|
<div class="col-4"><strong>Location</strong></div>
|
|
<div class="col-4"><strong>Time</strong></div>
|
|
<div class="col-4"><strong>Description</strong></div>
|
|
</div>
|
|
{% for happy_hour in happy_hours %}
|
|
<div class="row">
|
|
<div class="col-4">{{ happy_hour.location }}</div>
|
|
<div class="col-4">{{ happy_hour.starttime.strftime('%H:%M') }}
|
|
- {{ happy_hour.endtime.strftime('%H:%M') }}</div>
|
|
<div class="col-4">{{ happy_hour.description }}</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<p>Leider gibt es heute keine Happy Hours :(</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro %} |