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

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

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

11
12
{% block body %}
    <h1>{{ event.title }}</h1>
Joren Vrancken's avatar
Joren Vrancken committed
13
    <p class="tcenter">{{ event.description|bleach }}</p>
14

15
16
17
18
19
20
21
22
23
    {% if messages %}
        {% for message in messages %}
        <div class="alert alert-{{ message.tags }}">
            {{ message }}
            <button type="button" class="close"><span class="alert-icon-close"></span></button>
        </div>
        {% endfor %}
    {% endif %}

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
    <div class="clearfix row">
        <div class="span6">
            <table class="table borderless">
                <tbody>
                <tr>
                    <th>{% trans "from"|capfirst %}</th>
                    <td>{{ event.start }}</td>
                </tr>
                <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 %}
                    <tr>
                        <th>{% trans "price"|capfirst %}</th>
                        <td> &euro;{{ event.price }}</td>
                    </tr>
                {% endif %}
                {% 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>
                    <tr>
                        <th>{% trans "number of registrations"|capfirst %}</th>
                        <td>
                            {% blocktrans count counter=registrations|length trimmed %}
                                {{ counter }} registration
                            {% plural %}
                                {{ counter }} registrations
                            {% endblocktrans %}
                            {% if event.max_participants > 0 %}
64
                                <i>({{ event.max_participants }} {% trans "max" %})</i>
65
66
                                {% with prc=registration_percentage %}
                                    <div class="progress progress-style1">
67
                                        <div class="bar trans-enabled" style="width: {{ prc|floatformat:"0" }}%;" data-width="{{ prc|floatformat:"0" }}%"></div>
68
69
70
71
72
73
74
75
76
                                    </div>
                                {% endwith %}
                            {% endif %}
                        </td>
                    </tr>
                    {% if registration %}
                        <tr>
                            <th>{% trans "registration status"|capfirst %}</th>
                            <td>
Luuk Scholten's avatar
Luuk Scholten committed
77
78
79
80
81
82
83
84
85
86
87
                                {% 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 %}
88
89
90
91
92
                            </td>
                        </tr>
                    {% endif %}
                {% endif %}
                <tr>
Luuk Scholten's avatar
Luuk Scholten committed
93
                    <td></td>
94
                    <td>
95
                        {% if request.user.is_authenticated and request.user.member is not None and request.user.member.current_membership is not None and request.user.member.can_attend_events %}
96
97
98
99
100
101
102
                            {% if event.status == event.REGISTRATION_OPEN or event.status == event.REGISTRATION_OPEN_NO_CANCEL %}
                                {% if registration is not None and registration.date_cancelled is None and event.has_fields %}
                                <a class="btn btn-style1" href="{% url 'events:registration' event.id 'update' %}">{% trans "Update registration" %}</a>
                                <br /><br />
                                {% endif %}
                            {% endif %}
                            {% if event.status == event.REGISTRATION_OPEN or event.status == event.REGISTRATION_CLOSED_CANCEL_ONLY or event.status == event.REGISTRATION_OPEN_NO_CANCEL %}
103
                                {% if registration is None or registration.date_cancelled is not None %}
104
                                    {% if event.status == event.REGISTRATION_OPEN or event.status == event.REGISTRATION_OPEN_NO_CANCEL %}
105
106
107
108
109
110
111
112
113
                                    <a class="btn btn-style1" href="{% url 'events:registration' event.id 'register' %}">
                                        {% if event.reached_participants_limit %}
                                            {% trans "Put me on the waiting list" %}
                                        {% else %}
                                            {% trans "Register" %}
                                        {% endif %}
                                    </a>
                                    {% endif %}
                                {% elif registration is not None and registration.date_cancelled is None %}
114
115
                                    {# Special message to accept costs when cancelling after the deadline, unless member is on the waiting list #}
                                    {% if registration.queue_position == 0 and event.after_cancel_deadline %}
116
                                        <a class="btn btn-style1" href="{% url 'events:registration' event.id 'cancel' %}" onclick="return confirm('{% blocktrans 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 %}');">{% trans "Cancel registration" %}</a>
117
118
119
                                    {% else %}
                                        <a class="btn btn-style1" href="{% url 'events:registration' event.id 'cancel' %}" onclick="return confirm('{% trans "Are you sure you want to cancel your registration?" %}');">{% trans "Cancel registration" %}</a>
                                    {% endif %}
120
121
                                {% endif %}
                            {% endif %}
122
                        {% elif request.user.is_authenticated is False %}
123
124
                        <a class="btn btn-style1" href="{% url 'login' %}?next={{ request.path }}">{% trans "Login" %}</a>
                        {% endif %}
125
126
127
128
129
130
131
					</td>
                </tr>
                <tr>
	                <td>
	                </td>
                    <td>
                        <em>
132
                        {% if not request.user.is_authenticated %}
133
                            {% trans "You have to log in before you can register for this event." %}
134
135
136
137
138
139
140
141
142
                        {% elif event.status == event.REGISTRATION_NOT_YET_OPEN %}
                            {% blocktrans with datetime=event.registration_start %}Registration will open {{ datetime }}{% endblocktrans %}
                        {% elif event.status == event.REGISTRATION_CLOSED or event.status == event.REGISTRATION_CLOSED_CANCEL_ONLY %}
                            {% blocktrans %}Registration is not possible anymore.{% endblocktrans %}
                        {% elif status == event.REGISTRATION_NOT_NEEDED %}
                            {% if event.no_registration_message %}
                                {{ event.no_registration_message }}
                            {% else %}
                                {% trans "No registration required" %}
143
                            {% endif %}
144
                        {% endif %}
145
                        {% if event.status == event.REGISTRATION_OPEN_NO_CANCEL or event.status == event.REGISTRATION_CLOSED  %}
146
147
                            {% if registration.date_cancelled is None and event.fine > 0 %}
                                {% blocktrans 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 %}
148
149
                            {% endif %}
                        {% endif %}
150
151
152
                        </em>
                    </td>
                </tr>
153

154
155
156
157
158
159
160
                {% if event.pizzaevent %}
                <tr>
                    <th>
                        Pizza
                    </th>
                    <td>
                        <a href="{% url "pizzas:index" %}" class="btn btn-style1">
Joren Vrancken's avatar
Joren Vrancken committed
161
                            {% trans "Order" context "pizzas" %}
162
163
164
165
                        </a>
                    </td>
                </tr>
                {% endif %}
166
167
168
169
170
171
172
173
174
175
176
177
178
            </tbody>
        </table>
    </div>

    <div class="span6">
        <div class="location-map">
            <img src="https://maps.googleapis.com/maps/api/staticmap?center={{ event.map_location|urlencode }}&zoom=13&size=450x250&markers={{ event.map_location|urlencode }}"/>
        </div>
    </div>
</div>

    {% if user.is_authenticated and registrations|length > 0 %}
        <div class="member-directory">
179
            <h1 class="midhead">{% trans "Registrations" %}</h1>
180
181
            <ul class="member-directory row">
                {% for registration in registrations %}
182
                    <li class="post member-item span3 has-overlay">
183
184
185
                    {% if registration.is_external %}
                        <a href="#">
                            <div class="post-inner">
Luuk Scholten's avatar
Luuk Scholten committed
186
                                <div class="inner-img">
187
                                    <img alt="{{ registration.name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
Luuk Scholten's avatar
Luuk Scholten committed
188
                                </div>
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
                                <div class="post-overlay">
                                    <div class="post-overlay-meta">
                                        <h2>{{ registration.name }}</h2>
                                        <p></p>
                                    </div>
                                </div>
                                <div class="post-body avatar-subtitle">
                                    {{ registration.name }}
                                </div>
                            </div>
                        </a>
                    {% else %}
                        <a href="{% url 'members:profile' pk=registration.member.pk %}">
                            <div class="post-inner">
                                <div class="inner-img">
204
205
206
207
208
                                    {% if not registration.member.photo %}
                                    <img alt="{{ member.display_name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
                                    {% else %}
                                    <img alt="{{ member.display_name }}" src="{% thumbnail registration.member.photo '220x220' %}" width="220" height="220" />
                                    {% endif %}
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
                                </div>
                                <div class="post-overlay">
                                    <div class="post-overlay-meta">
                                        <h2>{{ registration.member.display_name }}</h2>
                                        <p>{% trans "cohort"|capfirst %}: {{ registration.member.starting_year }}</p>
                                    </div>
                                </div>
                                <div class="post-body avatar-subtitle">
                                    {{ registration.member.display_name }}
                                </div>
                            </div>
                        </a>
                    {% endif %}
                    </li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}
{% endblock body %}