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

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

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

11
{% block body %}
12
13
14
    <section class="page-section" id="events-detail">
        <div class="container">
            <h1 class="text-center section-title">{{ event.title }}</h1>
15

16
17
18
19
20
21
22
23
24
25
            {% if messages %}
                {% for message in messages %}
                    <div class="alert alert-{{ message.tags }} alert-dismissable">
                        {{ message }}
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                {% endfor %}
            {% endif %}
26

27
28
29
            <div class="m-4">
                {{ event.description|bleach }}
            </div>
30

31
32
33
34
            <div class="clearfix row">
                <div class="col-6">
                    <table class="table table-borderless">
                        <tbody>
35
                        <tr>
36
37
                            <th>{% trans "from"|capfirst %}</th>
                            <td>{{ event.start }}</td>
38
                        </tr>
39
40
41
42
43
44
45
46
47
                        <tr>
                            <th>{% trans "until"|capfirst %}</th>
                            <td>{{ event.end }}</td>
                        </tr>
                        <tr>
                            <th>{% trans "location"|capfirst %}</th>
                            <td>{{ event.location }}</td>
                        </tr>
                        {% if event.price > 0 %}
48
                            <tr>
49
50
                                <th>{% trans "price"|capfirst %}</th>
                                <td> &euro;{{ event.price }}</td>
51
52
                            </tr>
                        {% endif %}
53
54
55
56
57
58
59
60
61
                        {% if event.registration_required %}
                            <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>
62
                            <tr>
63
                                <th>{% trans "number of registrations"|capfirst %}</th>
64
                                <td>
65
66
67
68
69
70
71
72
73
                                    {% 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">
74
                                                <div class="progress-bar progress{{ prc|floatformat:"0" }}"></div>
75
76
                                            </div>
                                        {% endwith %}
77
78
79
                                    {% endif %}
                                </td>
                            </tr>
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
                            {% 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>
110
                                {% endif %}
111
112
113
114
115
116
117
118
119
120
121
                                {% if event.price > 0 %}
                                    <tr>
                                        <th>{% trans "payment status"|capfirst %}</th>
                                        <td>
                                            {% if registration.is_paid %}
                                                {% trans "You have paid" %}
                                            {% else %}
                                                {% trans "You have not paid yet" %}
                                            {% endif %}
                                        </td>
                                    </tr>
122
                                {% endif %}
123
124
                            {% endif %}
                        {% endif %}
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
                        <tr>
                            <td></td>
                            <td>
                                {% if permissions.update_registration %}
                                    <form action="{% url 'events:registration' event.id %}" method="get">
                                        <input type="submit" class="btn btn-primary"
                                               value="{% trans "Update registration" %}"/>
                                    </form>
                                {% endif %}
                                {% if permissions.create_registration %}
                                    <p>
                                        {% url 'event-registration-terms' as terms_url %}
                                        {% 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 %}
149

150
151
152
153
154
155
156
157
158
159
                                            <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" %}"
160
                                                   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 full costs of €{{ costs }}? You will not be able to undo this!{% endblocktrans %}');"/>
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
                                        {% 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>
                                {% elif request.user.is_authenticated is False %}
                                    <a class="btn btn-primary"
                                       href="{% url 'login' %}?next={{ request.path }}">{% trans "Login" %}</a>
                                {% endif %}
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <em>
                                    {% if not request.user.is_authenticated %}
                                        {% 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 %}
188
189
190
                                            {% blocktrans trimmed with datetime=event.registration_start  %}
                                                Registration will open {{ datetime }}
                                            {% endblocktrans %}
191
                                        {% elif not event.registration_allowed %}
192
193
194
                                            {% blocktrans trimmed %}
                                                Registration is not possible anymore.
                                            {% endblocktrans %}
195
196
                                        {% endif %}
                                        {% if event.after_cancel_deadline and permissions.cancel_registration %}
197
198
199
                                            {% 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 %}
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
                                        {% endif %}
                                    {% endif %}
                                </em>
                            </td>
                        </tr>

                        {% if event.pizzaevent %}
                            <tr>
                                <th>
                                    Pizza
                                </th>
                                <td>
                                    <a href="{% url "pizzas:index" %}" class="btn btn-style1">
                                        {% trans "Order" context "pizzas" %}
                                    </a>
                                </td>
                            </tr>
                        {% endif %}
                        </tbody>
                    </table>
                </div>
221

222
223
                <div class="col-6">
                    <div class="location-map">
224
                        <img src="{% google_map_url event.map_location %}" alt="{{ event.location }}" />
225
226
227
                    </div>
                </div>
            </div>
228
        </div>
229
    </section>
230

231
    {% if user.is_authenticated and event.participants|length > 0 %}
232
233
234
235
236
237
238
        <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 %}
239
240
                                {% static 'members/images/default-avatar.jpg' as image %}
                                {% grid_item title=registration.name image_url=image %}
241
242
243
244
245
246
247
248
                            {% else %}
                                {% member_card registration.member %}
                            {% endif %}
                        </div>
                    {% endfor %}
                </div>
            </div>
        </section>
249
250
    {% endif %}
{% endblock body %}