event.html 13.6 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 13
{% block body %}
    <h1>{{ event.title }}</h1>

14 15 16 17 18 19 20 21 22
    {% 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 %}

23 24
    <p class="tcenter">{{ event.description|bleach }}</p>

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
    <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>
59
                            {% blocktrans count counter=event.participants|length trimmed %}
60 61 62 63 64
                                {{ counter }} registration
                            {% plural %}
                                {{ counter }} registrations
                            {% endblocktrans %}
                            {% if event.max_participants > 0 %}
65
                                <i>({{ event.max_participants }} {% trans "max" %})</i>
66 67
                                {% with prc=registration_percentage %}
                                    <div class="progress progress-style1">
68
                                        <div class="bar trans-enabled" style="width: {{ prc|floatformat:"0" }}%;" data-width="{{ prc|floatformat:"0" }}%"></div>
69 70 71 72 73 74 75 76 77
                                    </div>
                                {% endwith %}
                            {% endif %}
                        </td>
                    </tr>
                    {% if registration %}
                        <tr>
                            <th>{% trans "registration status"|capfirst %}</th>
                            <td>
Luuk Scholten's avatar
Luuk Scholten committed
78 79 80 81 82 83 84 85 86 87 88
                                {% 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 %}
89 90 91
                            </td>
                        </tr>
                    {% endif %}
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
                    {% 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>
                        {% endif %}
                        {% 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>
                        {% endif %}
                    {% endif %}
118
                {% endif %}
119
                <tr>
Luuk Scholten's avatar
Luuk Scholten committed
120
                    <td></td>
121
                    <td>
122 123 124 125 126 127
                        {% if permissions.update_registration %}
                            <form action="{% url 'events:registration' event.id %}" method="get">
                                <input type="submit" class="btn btn-style1" value="{% trans "Update registration" %}" />
                            </form>
                        {% endif %}
                        {% if permissions.create_registration %}
128 129
                            <p>
                                {% url 'event-registration-terms' as terms_url %}
Joren Vrancken's avatar
Joren Vrancken committed
130
                                {% blocktrans trimmed %}
131 132 133 134 135
                                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>
136 137 138 139
                            <form action="{% url 'events:register' event.id %}" method="post">{% csrf_token %}
                                {% if event.reached_participants_limit %}
                                    <input type="submit" class="btn btn-style1" value="{% trans "Put me on the waiting list" %}" />
                                {% else %}
140

141 142 143 144 145 146 147 148 149
                                    <input type="submit" class="btn btn-style1" 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-style1" value="{% trans "Cancel registration" %}" 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 %}');" />
                                {% else %}
150
                                    <input type="submit" class="btn btn-style1" value="{% trans "Cancel registration" %}" onclick="return confirm('{% trans 'Are you sure you want to cancel your registration?' %}');" />
151 152
                                {% endif %}
                            </form>
153
                        {% elif request.user.is_authenticated is False %}
154
                            <a class="btn btn-style1" href="{% url 'login' %}?next={{ request.path }}">{% trans "Login" %}</a>
155
                        {% endif %}
156 157 158 159 160 161 162
					</td>
                </tr>
                <tr>
	                <td>
	                </td>
                    <td>
                        <em>
163
                        {% if not request.user.is_authenticated %}
164
                            {% trans "You have to log in before you can register for this event." %}
165
                        {% else %}
166
                            {% if not event.registration_required %}
167 168 169 170 171
                                {% if event.no_registration_message %}
                                    {{ event.no_registration_message }}
                                {% else %}
                                    {% trans "No registration required" %}
                                {% endif %}
172 173 174 175
                            {% elif not event.registration_started %}
                                {% blocktrans with datetime=event.registration_start %}Registration will open {{ datetime }}{% endblocktrans %}
                            {% elif not event.registration_allowed %}
                                {% blocktrans %}Registration is not possible anymore.{% endblocktrans %}
176
                            {% endif %}
177
                            {% if event.after_cancel_deadline and permissions.cancel_registration %}
178
                                {% 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 %}
179 180
                            {% endif %}
                        {% endif %}
181 182 183
                        </em>
                    </td>
                </tr>
184

185 186 187 188 189 190 191
                {% if event.pizzaevent %}
                <tr>
                    <th>
                        Pizza
                    </th>
                    <td>
                        <a href="{% url "pizzas:index" %}" class="btn btn-style1">
Joren Vrancken's avatar
Joren Vrancken committed
192
                            {% trans "Order" context "pizzas" %}
193 194 195 196
                        </a>
                    </td>
                </tr>
                {% endif %}
197 198 199 200 201 202 203 204 205 206 207
            </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>

208
    {% if user.is_authenticated and event.participants|length > 0 %}
209
        <div class="member-directory">
210
            <h1 class="midhead">{% trans "Registrations" %}</h1>
211
            <ul class="member-directory row">
212
                {% for registration in event.participants %}
213
                    <li class="post member-item span3 has-overlay">
214 215 216
                    {% if registration.is_external %}
                        <a href="#">
                            <div class="post-inner">
Luuk Scholten's avatar
Luuk Scholten committed
217
                                <div class="inner-img">
218
                                    <img alt="{{ registration.name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
Luuk Scholten's avatar
Luuk Scholten committed
219
                                </div>
220 221 222 223 224 225 226 227 228 229 230 231
                                <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 %}
232
                        <a href="{% url 'members:profile' pk=registration.member.pk %}">
233 234
                            <div class="post-inner">
                                <div class="inner-img">
235 236
                                    {% if not registration.member.profile.photo %}
                                    <img alt="{{ registration.member.profile.display_name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
237
                                    {% else %}
238
                                    <img alt="{{ registration.member.profile.display_name }}" src="{% thumbnail registration.member.profile.photo '220x220' %}" width="220" height="220" />
239
                                    {% endif %}
240 241 242
                                </div>
                                <div class="post-overlay">
                                    <div class="post-overlay-meta">
243 244
                                        <h2>{{ registration.member.profile.display_name }}</h2>
                                        <p>{% trans "cohort"|capfirst %}: {{ registration.member.profile.starting_year }}</p>
245 246 247
                                    </div>
                                </div>
                                <div class="post-body avatar-subtitle">
248
                                    {{ registration.member.profile.display_name }}
249 250 251 252 253 254 255 256 257 258
                                </div>
                            </div>
                        </a>
                    {% endif %}
                    </li>
                {% endfor %}
            </ul>
        </div>
    {% endif %}
{% endblock body %}