fixed happy hour bug

This commit is contained in:
Götz 2017-10-16 17:52:32 +02:00
parent abdf5e91f6
commit 32f4c1acaa
3 changed files with 27 additions and 43 deletions

View File

@ -15,27 +15,7 @@
{{ macros.day_menu(title='Markusplatz', location_menu=markus_cafete, fail_text='Aktuell gibt es keine warmen Speisen') }}
</div>
<div class="row">
<div class="col p-2">
<div class="p-3 border border-dark rounded bg-light text-dark">
<h2>Happy Hour Guide von Feki.de</h2>
{% if happy_hours %}
<div class="row">
<div class="col-4">Location</div>
<div class="col-4">Time</div>
<div class="col-4">Description</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>
</div>
{{ macros.happy_hours(happy_hours=happy_hours) }}
</div>
</div>

View File

@ -15,28 +15,7 @@
{{ macros.week_menu(title='Markusplatz', location_menus=markus_cafete, fail_text='Aktuell gibt es keine warmen Speisen') }}
</div>
<div class="row">
<div class="col p-2">
<div class="p-3 border border-dark rounded bg-light text-dark">
<h2>Happy Hour Guide von Feki.de</h2>
{% if happy_hours %}
<div class="row">
<div class="col-4">Location</div>
<div class="col-4">Time</div>
<div class="col-4">Description</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>
</div>
{{ macros.happy_hours(happy_hours=happy_hours) }}
</div>
</div>
{% endblock %}

View File

@ -34,4 +34,29 @@
<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 %}