Asking for confirmation on past meals

master
Davide Bongiovanni 6 years ago
parent a0fa4a9d4d
commit 89c27077fd

@ -75,6 +75,10 @@ def getUpcomingMeals():
meals[-1]['meal_time'] = meals[-1]['meal_date'].strftime('%H:%M')
meals[-1]['meal_friendly_date'] = meals[-1]['meal_date'].strftime('%A %d %B')
meals[-1]['candidate'] = 'davide'
if (meals[-1]['meal_date'] - datetime.datetime.now()).total_seconds() < 0:
meals[-1]['needs_confirmation'] = True
else:
meals[-1]['needs_confirmation'] = False
r.close()
return meals

@ -38,10 +38,14 @@
{% if loop.index != 1 and (meal.meal_friendly_date != meals[loop.index - 2].meal_friendly_date) %}
<h2>{{meal.meal_friendly_date}}</h2>
{% endif %}
{% if meal.needs_confirmation %}
<div class="flex-card" onclick="location.href='/verify/{{meal.id}}';" style="cursor: pointer; width: 60%; justify-content: space-between;">
{% else %}
<div class="flex-card" onclick="location.href='/meal/{{meal.id}}';" style="cursor: pointer; width: 60%; justify-content: space-between;">
<span><b>{{meal.meal_time}}</b></span>
<p style="text-align: left;">{% if meal.kuk != "" %}<img class="flex-small-thumb" src="{{url_for('static', filename=meal.kuk + '.png')}}" title="{{meal.kuk}}" align="middle" style="margin: " /> &nbsp;&nbsp; <b>WILL</b>{% else %}<img class="flex-small-thumb" src="{{url_for('static', filename=meal.candidate + '.png')}}" title="{{meal.kuk}}" align="middle" style="margin: " /> &nbsp;&nbsp; <b>SHOULD</b>{% endif%} cook for <br>{% for e in meal.eaters %}<img class="flex-small-thumb" src="{{url_for('static', filename=e + '.png')}}" title="{{e}}" align="middle"/>&nbsp; {% endfor %}</p>
<span>{% if meal.friendly_selection_deadline != '' %}Confirmed in {{meal.friendly_selection_deadline}}{% else %}Confirmed.{% endif %}</span>
{% endif %}
<span{% if meal.needs_confirmation%} style="color: #EE7500;"{% endif %}><b>{{meal.meal_time}}</b></span>
<p style="text-align: left;">{% if meal.needs_confirmation %}Has &nbsp;{% endif %}{% if meal.kuk != "" %}<img class="flex-small-thumb" src="{{url_for('static', filename=meal.kuk + '.png')}}" title="{{meal.kuk}}" align="middle" style="margin: " /> &nbsp; {% if not meal.needs_confirmation %}<b>WILL</b>{% endif %}{% else %}<img class="flex-small-thumb" src="{{url_for('static', filename=meal.candidate + '.png')}}" title="{{meal.kuk}}" align="middle" style="margin: " /> &nbsp; {% if not meal.needs_confirmation %}<b>SHOULD</b>{% endif %}{% endif%} cook{% if meal.needs_confirmation %}ed{% endif %} for <br>{% for e in meal.eaters %}<img class="flex-small-thumb" src="{{url_for('static', filename=e + '.png')}}" title="{{e}}" align="middle"/>&nbsp; {% endfor %}{% if meal.needs_confirmation %}<b>?</b>{% endif %}</p>
{% if meal.needs_confirmation %}<span style="color: #EE7500;">Please verify.{% else %}<span>{% if meal.friendly_selection_deadline != '' %}Confirmed in {{meal.friendly_selection_deadline}}{% else %}Confirmed.{% endif %}{% endif %}</span>
</div>
{% endfor%}
<h2> &nbsp; </h2>

Loading…
Cancel
Save