overview.html 3.32 KB
Newer Older
1
2
{% extends "base.html" %}
{% load i18n staticfiles compress %}
Jim Driessen's avatar
Jim Driessen committed
3

4
5
6
7
{% block title %}{{ event.title }} — {% trans "pizzas"|capfirst %} —
    {{ block.super }}{% endblock %}
{% block opengraph_title %}{{ event.title }} — {% trans "pizzas"|capfirst %} —
    {{ block.super }}{% endblock %}
Jim Driessen's avatar
Jim Driessen committed
8
9
10


{% block body %}
11
    <section class="page-section" id="pizzas-overview">
12
13
14
15
16
17
        <div class="container">
            <h1 class="text-center section-title">
                {% blocktrans trimmed with title=event.title %}
                    Orders for {{ title }}
                {% endblocktrans %}
            </h1>
Jim Driessen's avatar
Jim Driessen committed
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
73
74
75
76
77
78
79
80
81
            <a href="{% url 'pizzas:orders' event.pk %}"
               class="btn btn-primary float-right mb-3">
                {% trans "Back" %}
            </a>

            <div class="table-responsive">
                <table
                    class="table table-bordered">
                    <thead>
                    <tr>
                        <th scope="col">
                            {% trans "Product" %}
                        </th>
                        <th scope="col">
                            {% trans "Price" %}
                        </th>
                        <th scope="col">
                            {% trans "Amount" %}
                        </th>
                        <th scope="col">
                            {% trans "Total" %}
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for product in product_list %}
                        <tr>
                            <td>
                                {{ product.name }}
                            </td>
                            <td>
                                &euro;&nbsp;{{ product.price }}
                            </td>
                            <td>
                                {{ product.amount }}
                            </td>
                            <td>
                                &euro;&nbsp;{{ product.total }}
                            </td>
                        </tr>
                    {% empty %}
                        <tr>
                            <th colspan="4">
                                {% trans "Nobody ordered yet" %}
                            </th>
                        </tr>
                    {% endfor %}
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="2"></td>
                        <td>
                            {{ total_products }}
                        </td>
                        <td>
                            &euro;&nbsp;{{ total_money }}
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </section>
Jim Driessen's avatar
Jim Driessen committed
82
83
84
{% endblock %}

{% block js_body %}
85
86
87
88
89
90
    {{ block.super }}
    {% compress js %}
        <script type="text/javascript"
                src="{% static "pizzas/js/jquery.tablesort.min.js" %}"></script>
        <script type="text/javascript"
                src="{% static "pizzas/js/main.js" %}"></script>
Jim Driessen's avatar
Jim Driessen committed
91

92
93
94
95
96
        <script type="text/javascript">
            var csrf_token = '{{ csrf_token }}';
            var trans = {'yes': '{% trans 'Yes' %}', 'no': '{% trans 'No' %}'};
        </script>
    {% endcompress %}
Jim Driessen's avatar
Jim Driessen committed
97
{% endblock %}