{% extends "base.html" %} {% block title %}Weekends - Edward Betts{% endblock %} {% 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 %} {% 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 }} </td> <td class="text-end text-nowrap{{ extra_class }}"> {{ weekend.date.strftime("%-d %b %Y") }} </td> {% for day in "saturday", "sunday" %} {% if extra_class %}<td class="{{ extra_class|trim }}">{% else %}<td>{% endif %} {% if weekend[day] %} {% for event in weekend[day] %} <a href="{{ event.url }}">{{ event.title }}</a>{% if not loop.last %},{%endif %} {% endfor %} {% else %} <strong>free</strong> {% endif %} </td> {% endfor %} </tr> {% endfor %} </tbody> </table> </div> {% endblock %}