Adapted view meal page to newer backend

master
Davide Bongiovanni 6 years ago
parent 1e0668ad77
commit 3853c6aeb3

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Meal planned for {{meal_date}} - KUKAPP</title> <title>Meal planned for {{meal.meal_friendly_date}} - KUKAPP</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
<script src="{{ url_for('static', filename='script.js') }}"></script> <script src="{{ url_for('static', filename='script.js') }}"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
@ -29,34 +29,34 @@
{% endfor %} {% endfor %}
</div> </div>
<div class="right-pane"> <div class="right-pane">
<h1>When: {{date}}</h1> <h1>When: {{meal.meal_friendly_date}}</h1>
<h2>Cook</h2> <h2>Cook</h2>
<div class="flex-card"> <div class="flex-card">
{% if cook.confirmed == "no" %} {% if meal.kuk == "" %}
<img src="{{url_for('static', filename='question.png')}}"> <img src="{{url_for('static', filename='question.png')}}">
<p>If nobody volunteers,<br><img class="flex-small-thumb" src="{{url_for('static', filename=cook.name + '.png')}}" title="{{current_user.name}}" align="middle"> will cook.</p> <p>If nobody volunteers,<br><img class="flex-small-thumb" src="{{url_for('static', filename=meal.kuk + '.png')}}" title="{{current_user.name}}" align="middle"> will cook.</p>
<div class="rect-button" onclick="location.href='/volunteer';" style="background-color: #EE7500;">VOLUNTEER</div> <div class="rect-button" onclick="location.href='/volunteer';" style="background-color: #EE7500;">VOLUNTEER</div>
{% else %} {% else %}
<img src="{{url_for('static', filename= cook.name + '.png')}}"> <img src="{{url_for('static', filename=meal.kuk + '.png')}}">
<span>{{ cook.name }}</span> <span class="username">{{ meal.kuk }}</span>
<div class="rect-button" style="background-color: #8faf38; cursor: default;">CONFIRMED</div> <div class="rect-button" style="background-color: #8faf38; cursor: default;">CONFIRMED</div>
{% endif %} {% endif %}
</div> </div>
<h2>Eaters</h2> <h2>Eaters</h2>
{% for eater in eaters %} {% for eater in meal.eaters %}
<div class="flex-card"> <div class="flex-card">
<img src="{{url_for('static', filename=eater + '.png')}}"> <img src="{{url_for('static', filename=eater + '.png')}}">
<span>{{ eater }}</span> <span class="username">{{ eater }}</span>
</div> </div>
{% endfor %} {% endfor %}
{% if not current_user.name in eaters %} {% if not current_user.name in eaters and current_user.name != meal.kuk %}
<div class="flex-card" style="background: none; box-shadow: none"> <div class="flex-card" style="background: none; box-shadow: none">
<div class="round-button" onclick="location.href='/addme';"><i class="fa fa-plus" aria-hidden="true"></i></div> <div class="round-button" onclick="location.href='/addme?meal={{meal.id}}';"><i class="fa fa-plus" aria-hidden="true"></i></div>
<span>Add me</span> <span>Add me</span>
</div> </div>
{% else %} {% else %}
<div class="flex-card" style="background: none; box-shadow: none"> <div class="flex-card" style="background: none; box-shadow: none">
<div class="round-button" onclick="location.href='/removeme';"><i class="fa fa-minus" aria-hidden="true"></i></div> <div class="round-button" onclick="location.href='/removeme?meal={{meal.id}}';"><i class="fa fa-minus" aria-hidden="true"></i></div>
<span>Remove me</span> <span>Remove me</span>
</div> </div>
{% endif %} {% endif %}

Loading…
Cancel
Save