roster_t.djhtml
1 |
|
2 |
This is the roster template. You can use this to display a hourly roster, |
3 |
spread over a series of days. To function properly, this template requires |
4 |
the following variables: |
5 |
- days :: A list of all days for which a column must be made. |
6 |
- time_blocks :: A list of all rows with their respective timings, that must |
7 |
be displayed in the roster. These elements must *not* contain |
8 |
any unsafe elements! |
9 |
- conflicts :: A dictionary with all conflicting events that need to be listed. |
10 |
{% endcomment %} |
11 |
|
12 |
<table> |
13 |
<th> |
14 |
{#<td></td> {# Empty row for hours #} {# Apparantly this isn't necessary with <th /> #} |
15 |
{% for day in days %} |
16 |
<td>{{ day|date:"l d/m" }}</td> |
17 |
{% endfor %} |
18 |
</th> |
19 |
{% for element in time_blocks %} |
20 |
{{ element|safe }} |
21 |
{% endfor %} |
22 |
</table> |
23 |
{% for number, conflict_list in conflicts.items %} |
24 |
<h2 id="Conflict {{ number }}">Conflict {{ number }}</h2> |
25 |
{% for conflict in conflict_list %} |
26 |
{% if conflict.recently_created %} |
27 |
<p class="conflict event-new"> |
28 |
{% elif conflict.recently_updated %} |
29 |
<p class="conflict event-update"> |
30 |
{% else %} |
31 |
<p class="conflict event" style="background-color: #{{ conflict.course.course.color }};"> |
32 |
{% endif %} |
33 |
<a href="{% url "courses-course-index" conflict.course.course.slug_name %}"> |
34 |
{{ conflict.course.course.name }}</a><br /> |
35 |
{# FIXME Temporarily disabled until all users have an associated user_data #} |
36 |
{#<a href="{% url "administration-user" conflict.docent.user_data.slug_name %}">#} |
37 |
{#{{ conflict.docent }}</a><br />#} |
38 |
{{ conflict.docent }}<br /> |
39 |
{{ conflict.begin_time|date:"H:i" }} - {{ conflict.end_time|date:"H:i" }}<br /> |
40 |
<a href="{% url "administration-room-detail" conflict.room %}"> |
41 |
{{ conflict.room }}</a> ({{ conflict.subject }}) |
42 |
</p> |
43 |
{% endfor %} |
44 |
{% endfor %} |
45 |