event.html 16.5 KB
Newer Older
1
{% extends "base.html" %}
2
3
{% load i18n static bleach_tags thumbnail member_card google_map_url grid_item alert document_cards slider %}

4

5
{% block title %}{{ event.title }} — {% trans "Calendar"|capfirst %} — {{ block.super }}{% endblock %}
6
7
8
{% block opengraph_title %}{{ event.title }} — {% trans "Calendar"|capfirst %} — {{ block.super }}{% endblock %}

{% block opengraph %}
9
    <meta property="og:description" content="{{ event.description|striptags|truncatewords:10 }}"/>
10
{% endblock %}
11

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


{% block body_class %}event-slide{% endblock %}
{% block header_image_container %}
    {% if event.slide %}
        <div id="announcements-slider" class="carousel slide w-100 h-100"
             data-ride="carousel">
            <img class="image"
                 src="{% thumbnail event.slide.content slide_size %}"
                 alt="{{ event.slide.title }}">
        </div>
    {% else %}
        {{ block.super }}
    {% endif %}
{% endblock header_image_container %}

28
{% block body %}
29
30
31
    <section class="page-section" id="events-detail">
        <div class="container">
            <h1 class="text-center section-title">{{ event.title }}</h1>
32

33
34
            {% if messages %}
                {% for message in messages %}
35
                    {% alert message.tags message dismissible=True %}
36
37
                {% endfor %}
            {% endif %}
38

39
            <div class="mx-4 m-lg-4">
40
41
                {{ event.description|bleach }}
            </div>
42

43
            <div class="clearfix row">
44
                <div class="col-12 col-md-6 order-1">
45
46
                    <table class="table table-borderless">
                        <tbody>
47
                        <tr>
48
49
                            <th>{% trans "from"|capfirst %}</th>
                            <td>{{ event.start }}</td>
50
                        </tr>
51
52
53
54
55
56
57
58
                        <tr>
                            <th>{% trans "until"|capfirst %}</th>
                            <td>{{ event.end }}</td>
                        </tr>
                        <tr>
                            <th>{% trans "location"|capfirst %}</th>
                            <td>{{ event.location }}</td>
                        </tr>
Thijs de Jong's avatar
Thijs de Jong committed
59
60
61
62
                        <tr>
                            <th>{% trans "organiser"|capfirst %}</th>
                            <td><a href={{ event.organiser.get_absolute_url }}>{{ event.organiser }}</a></td>
                        </tr>
63
                        {% if event.price > 0 %}
64
                            <tr>
65
66
                                <th>{% trans "price"|capfirst %}</th>
                                <td> &euro;{{ event.price }}</td>
67
68
                            </tr>
                        {% endif %}
69
                        {% if event.registration_required %}
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
                            {% if request.user.is_authenticated %}
                                <tr>
                                    <th>{% trans "registration deadline"|capfirst %}</th>
                                    <td>{{ event.registration_end }}</td>
                                </tr>
                                <tr>
                                    <th>{% trans "cancellation deadline"|capfirst %}</th>
                                    <td>{{ event.cancel_deadline }}</td>
                                </tr>
                                <tr>
                                    <th>{% trans "number of registrations"|capfirst %}</th>
                                    <td>
                                        {% blocktrans count counter=event.participants|length trimmed %}
                                            {{ counter }} registration
                                        {% plural %}
                                            {{ counter }} registrations
                                        {% endblocktrans %}
                                        {% if event.max_participants > 0 %}
                                            <i>({{ event.max_participants }} {% trans "max" %})</i>
                                            {% with prc=registration_percentage %}
                                                <div class="progress mt-1">
                                                    <div class="progress-bar progress{{ prc|floatformat:"0" }}"></div>
                                                </div>
                                            {% endwith %}
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endif %}
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
                            {% if registration %}
                                <tr>
                                    <th>{% trans "registration status"|capfirst %}</th>
                                    <td>
                                        {% if registration.is_registered and registration.queue_position == 0 %}
                                            {% trans "You are registered" %}
                                        {% elif registration.is_registered and registration.queue_position > 0 %}
                                            {% blocktrans with pos=registration.queue_position trimmed %}
                                                Waiting list position {{ pos }}
                                            {% endblocktrans %}
                                        {% elif not registration.is_registered and registration.is_late_cancellation %}
                                            {% trans "Your registration is cancelled after the cancellation deadline" %}
                                        {% else %}
                                            {% trans "Your registration is cancelled" %}
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endif %}
                            {% if registration.is_invited %}
                                {% if event.start < date_now %}
                                    <tr>
                                        <th>{% trans "presence"|capfirst %}</th>
                                        <td>
                                            {% if registration.present %}
                                                {% trans "You were present" %}
                                            {% else %}
                                                {% trans "You were not present" %}
                                            {% endif %}
                                        </td>
                                    </tr>
128
                                {% endif %}
129
130
131
132
133
                                {% if event.price > 0 %}
                                    <tr>
                                        <th>{% trans "payment status"|capfirst %}</th>
                                        <td>
                                            {% if registration.is_paid %}
134
135
136
137
138
                                                {% if registration.payment.type == payment_method_tpay %}
                                                    {% trans "You pay with Thalia Pay" %}
                                                {% else %}
                                                    {% trans "You have paid" %}
                                                {% endif %}
139
140
                                            {% else %}
                                                {% trans "You have not paid yet" %}
141
142
143
144
145
146
147
                                                {% if registration.member.tpay_enabled %}
                                                    <form action="{% url 'events:pay' event.id %}" method="post">
                                                        {% csrf_token %}
                                                        <input type="submit" class="btn btn-primary"
                                                               value="{% trans "Pay with Thalia Pay" %}"/>
                                                    </form>
                                                {% endif %}
148
149
150
                                            {% endif %}
                                        </td>
                                    </tr>
151
                                {% endif %}
152
153
                            {% endif %}
                        {% endif %}
154
155
156
157
158
                        <tr>
                            <td></td>
                            <td>
                                {% if permissions.update_registration %}
                                    <form action="{% url 'events:registration' event.id %}" method="get">
Thijs de Jong's avatar
Thijs de Jong committed
159
                                        <input type="submit" class="btn btn-primary mb-2"
160
161
162
163
164
                                               value="{% trans "Update registration" %}"/>
                                    </form>
                                {% endif %}
                                {% if permissions.create_registration %}
                                    <p>
165
                                        {% url 'singlepages:event-registration-terms' as terms_url %}
166
167
168
169
170
171
172
173
174
175
176
177
                                        {% blocktrans trimmed %}
                                            By registering,
                                            you confirm that you have read the
                                            <a target="_blank" href="{{ terms_url }}">terms and conditions</a>,
                                            that you understand them and that you agree to be bound by them.
                                        {% endblocktrans %}
                                    </p>
                                    <form action="{% url 'events:register' event.id %}" method="post">{% csrf_token %}
                                        {% if event.reached_participants_limit %}
                                            <input type="submit" class="btn btn-primary"
                                                   value="{% trans "Put me on the waiting list" %}"/>
                                        {% else %}
178

179
180
181
182
183
184
185
186
187
188
                                            <input type="submit" class="btn btn-primary"
                                                   value="{% trans "Register" %}"/>
                                        {% endif %}
                                    </form>
                                {% elif permissions.cancel_registration %}
                                    {# Special message to accept costs when cancelling after the deadline, unless member is on the waiting list #}
                                    <form action="{% url 'events:cancel' event.id %}" method="post">{% csrf_token %}
                                        {% if registration.would_cancel_after_deadline %}
                                            <input type="submit" class="btn btn-primary"
                                                   value="{% trans "Cancel registration" %}"
Sébastiaan Versteeg's avatar
Sébastiaan Versteeg committed
189
                                                   onclick="return confirm('{% blocktrans trimmed with costs=event.fine %}The deadline has passed, are you sure you want to cancel your registration and pay the estimated full costs of €{{ costs }}? You will not be able to undo this!{% endblocktrans %}');"/>
190
191
192
193
194
195
                                        {% else %}
                                            <input type="submit" class="btn btn-primary"
                                                   value="{% trans "Cancel registration" %}"
                                                   onclick="return confirm('{% trans 'Are you sure you want to cancel your registration?' %}');"/>
                                        {% endif %}
                                    </form>
196
                                {% elif not request.user.is_authenticated and event.registration_required %}
197
198
199
200
201
202
203
204
205
206
                                    <a class="btn btn-primary"
                                       href="{% url 'login' %}?next={{ request.path }}">{% trans "Login" %}</a>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <em>
207
                                    {% if not request.user.is_authenticated and event.registration_required %}
208
209
210
211
212
213
214
215
216
                                        {% trans "You have to log in before you can register for this event." %}
                                    {% else %}
                                        {% if not event.registration_required %}
                                            {% if event.no_registration_message %}
                                                {{ event.no_registration_message }}
                                            {% else %}
                                                {% trans "No registration required" %}
                                            {% endif %}
                                        {% elif not event.registration_started %}
217
218
219
                                            {% blocktrans trimmed with datetime=event.registration_start  %}
                                                Registration will open {{ datetime }}
                                            {% endblocktrans %}
220
                                        {% elif not event.registration_allowed %}
221
222
223
                                            {% blocktrans trimmed %}
                                                Registration is not possible anymore.
                                            {% endblocktrans %}
224
                                        {% endif %}
225
                                        {% if event.after_cancel_deadline %}
226
227
228
                                            {% blocktrans trimmed with costs=event.fine %}
                                                Cancellation isn't possible anymore without having to pay the full costs of €{{ costs }}.
                                                Also note that you will be unable to re-register.{% endblocktrans %}
229
230
231
232
233
234
235
236
237
238
239
240
                                        {% endif %}
                                    {% endif %}
                                </em>
                            </td>
                        </tr>

                        {% if event.pizzaevent %}
                            <tr>
                                <th>
                                    Pizza
                                </th>
                                <td>
241
                                    <a href="{% url "pizzas:index" %}" class="btn btn-primary">
242
243
244
245
246
247
248
249
                                        {% trans "Order" context "pizzas" %}
                                    </a>
                                </td>
                            </tr>
                        {% endif %}
                        </tbody>
                    </table>
                </div>
250

251
                <div class="col-12 col-md-6 order-0 order-md-1 mb-4 mb-md-0">
252
                    <div class="location-map">
253
                        <img src="{% google_map_url event.map_location %}" alt="{{ event.location }}" />
254
255
256
                    </div>
                </div>
            </div>
257
        </div>
258
    </section>
259

260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
    {% if event.documents.exists %}
        <section class="page-section" id="events-documents">
            <div class="container">
                <h1 class="text-center section-title">{% trans "Documents" %}</h1>

                <div class="row mt-4">
                    {% for doc in event.documents.all %}
                        <div class="col-6 col-md-2 my-3">
                            {% event_document_card doc %}
                        </div>
                    {% endfor %}
                </div>
            </div>
        </section>
    {% endif %}

276
    {% if user.is_authenticated and event.participants|length > 0 %}
277
278
279
280
281
282
283
        <section class="page-section" id="events-registrations">
            <div class="container">
                <h1 class="text-center section-title">{% trans "Registrations" %}</h1>
                <div id="results" class="row mt-4">
                    {% for registration in event.participants %}
                        <div class="col-4 col-md-3 my-3">
                            {% if registration.is_external %}
284
285
                                {% static 'members/images/default-avatar.jpg' as image %}
                                {% grid_item title=registration.name image_url=image %}
286
287
288
289
290
291
292
293
                            {% else %}
                                {% member_card registration.member %}
                            {% endif %}
                        </div>
                    {% endfor %}
                </div>
            </div>
        </section>
294
295
    {% endif %}
{% endblock body %}