2024-02-21 13:06:40 +00:00
|
|
|
{% extends "base.html" %}
|
2024-04-16 22:01:16 +01:00
|
|
|
{% block title %}Weekends - Edward Betts{% endblock %}
|
2024-02-21 13:06:40 +00:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="p-2">
|
|
|
|
|
|
|
|
<h1>Weekends</h1>
|
|
|
|
<table class="table table-hover w-auto">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="text-end">Week</th>
|
|
|
|
<th class="text-end">Date</th>
|
|
|
|
<th>Saturday</th>
|
|
|
|
<th>Sunday</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
{% for weekend in items %}
|
2025-01-24 19:49:16 +00:00
|
|
|
{% set week_number = weekend.date.isocalendar().week %}
|
|
|
|
{% if week_number == current_week_number %}
|
|
|
|
{% set extra_class = " bg-warning-subtle" %}
|
|
|
|
{% else %}
|
|
|
|
{% set extra_class = "" %}
|
|
|
|
{% endif %}
|
|
|
|
<tr{% if week_number == current_week_number %} class="bg-warning-subtle"{% endif %}>
|
|
|
|
<td class="text-end{{ extra_class }}">
|
|
|
|
{{ week_number }}
|
2024-02-21 13:06:40 +00:00
|
|
|
</td>
|
2025-01-24 19:49:16 +00:00
|
|
|
<td class="text-end text-nowrap{{ extra_class }}">
|
2024-02-21 13:06:40 +00:00
|
|
|
{{ weekend.date.strftime("%-d %b %Y") }}
|
|
|
|
</td>
|
|
|
|
{% for day in "saturday", "sunday" %}
|
2025-01-24 19:49:16 +00:00
|
|
|
{% if extra_class %}<td class="{{ extra_class|trim }}">{% else %}<td>{% endif %}
|
2024-02-21 13:06:40 +00:00
|
|
|
{% if weekend[day] %}
|
|
|
|
{% for event in weekend[day] %}
|
|
|
|
<a href="{{ event.url }}">{{ event.title }}</a>{% if not loop.last %},{%endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
2024-03-05 11:29:52 +00:00
|
|
|
<strong>free</strong>
|
2024-02-21 13:06:40 +00:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|