vote.html 1.56 KB
Newer Older
Mathis Dedial's avatar
Mathis Dedial committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{% extends 'base.html' %} {% block content %}
<div class="list-group">
    {% for burger in burger_list %}
    <li class="list-group-item d-flex align-items-center justify-content-between">
        <div>
            <b>{{ burger.name }}</b>
            <br>
            <span>{{ burger.description }}</span>
        </div>
        <div>
            <ul>
                <li>
                    <b>Bread:</b> {{ bread.get(burger.bread) }}</li>
                <li>
                    <b>Patty:</b> {{ patty.get(burger.patty) }}</li>
                <li>
                    <b>Toppings:</b>
                    <ul>
                        {% for topping in burger.toppings.split(', ') %}
                        <li>{{ toppings.get(topping|int) }}</li>
                        {% endfor %}
                    </ul>
                </li>
                <li>
                    <b>Side:</b> {{ side.get(burger.side) }}</li>
            </ul>
        </div>
        <span class="badge badge-success badge-pill">{{ burger.vote_count }}</span>
        <form method="POST">
            {% if not burger.vote_id %}
                <button class="btn btn-success" type="submit">Like</button>
                <input type="hidden" name="action" value="like">
            {% else %}
                <button class="btn btn-danger" type="submit">Unlike</button>
                <input type="hidden" name="action" value="unlike">
            {% endif %}
            <input type="hidden" name="burger_id" value="{{ burger.id }}">
        </form>
    </li>
    {% endfor %}
</div>
Mathis Dedial's avatar
Merge    
Mathis Dedial committed
42
{% endblock content %}