vote.html 3.41 KB
Newer Older
Mathis Dedial's avatar
Mathis Dedial committed
1
{% extends 'base.html' %} {% block content %}
2
3
4
5
6
7
8

<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">
Mathis Dedial's avatar
Mathis Dedial committed
9
        <h2 class="text-center text-uppercase text-white">Pick your Favourites</h2>
10
11
        <hr class="star-light">
        <div class="text-center">
Mathis Dedial's avatar
Mathis Dedial committed
12
13
14
15
16
17
18
19
            <h5>
                Below you find a list of burgers that have been created so far.
                Have a look and give some love to your favourites!
                The burger that is ranked highest on March 28th at 11:59 pm will be available at the canteen Polyterasse on <!-- TODO -->
            </h5>
            <button class="btn btn-xl btn-outline-light mt-3" onclick="window.location.href='/new'">
                Create your own burger!
            </button>
Mathis Dedial's avatar
Mathis Dedial committed
20
        </div>
21
22
23
24
25
26
27
28
29
30
31
32
33
    </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 -->
Mathis Dedial's avatar
Mathis Dedial committed
34
                <h3 class="text-secondary mr-3">
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
73
74
75
76
77
                    {{ 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
78
        </div>
79
80
81
82

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