vote.html 3.19 KB
Newer Older
Mathis Dedial's avatar
Mathis Dedial committed
1
{% extends 'base.html' %} {% block content %}
2
3
4
5
6
7
8
9
10
11
12
13
14

<p class="lead">
    Create your a burger for the 125th anniversary of the AMIV!
</p>

<section class="bg-primary text-white text-center" id="info">
    <div class="container">
        <h2 class="text-center text-uppercase text-white">Create a Burger</h2>
        <hr class="star-light">
        <div class="text-center">
            <h5>You can create your own AMIV anniversary burger below. Everyone can vote on the submitted burgers to decide which
                one is the best. The most popular burger will be available at the canteen Polyterasse on .....</h5>
            </span>
Mathis Dedial's avatar
Mathis Dedial committed
15
        </div>
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
    </div>
</section>

<section class="masthead text-center">
    <div class="container">
        <h3>Burger Gallery</h3>
        <hr class="star-dark">
        <p class="highlight"></p>

        <div class="list-group">
            {% for burger in burger_list %}
            <li class="list-group-item d-flex align-items-center justify-content-between">
                <!-- Ranking -->
                <h3 class="text-secondary">
                    {{ loop.index }}.
                </h3>
                
                <div class="d-flex align-items-center justify-content-between">
                    <!-- Name & Ingredients -->
                    <div class="text-left w-50">
                        <h4 class="text-primary">{{ burger.name }}</h4>
                        <p class="mb-0">
                            {{ patty.get(burger.patty) }}
                            in a {{ bread.get(burger.bread) }}
                            with
                            {% for topping in burger.toppings.split(', ') %}
                                {{ toppings.get(topping|int) }}{{ ', ' if not loop.last }}
                            {% endfor %}
                            and a side of {{ side.get(burger.side) }}.
                        </p>
                    </div>

                    <!-- Description and username -->
                    <blockquote class="blockquote text-center mb-0 w-50">
                        <p class="mb-0">
                            {{ burger.description }}
                        </p>
                        <footer class="blockquote-footer">{{ burger.nethz }}</footer>
                    </blockquote>
                </div>

                <!-- Voting -->
                <div>
                    <h4 class="text-secondary mb-3">{{ burger.vote_count }} Votes</h4>
                    <form action="/vote" method="POST">
                        {% if not burger.vote_id %}
                        <button class="btn btn-primary" type="submit">
                            <img src="static/images/like.png" alt="Like"> Like
                        </button>
                        <input type="hidden" name="action" value="like"> {% else %}
                        <button class="btn btn-muted" type="submit">Unlike</button>
                        <input type="hidden" name="action" value="unlike"> {% endif %}
                        <input type="hidden" name="burger_id" value="{{ burger.id }}">
                    </form>
                </div>
            </li>
            {% endfor %}
Mathis Dedial's avatar
Mathis Dedial committed
73
        </div>
74
75
76
77

    </div>
</section>
{% endblock content %}