Show events before and after gaps

This commit is contained in:
Edward Betts 2023-12-28 20:32:55 +00:00
parent 45e4a04fb9
commit 7c54fdfe09
3 changed files with 54 additions and 15 deletions

View file

@ -17,13 +17,26 @@
<table class="table table-hover w-auto">
{% for start, end in gaps %}
<tr>
<td class="text-end">{{ start.strftime("%A, %-d %b %Y") }}</td>
<td class="text-end">{{ end.strftime("%A, %-d %b %Y") }}</td>
<td>{{ (end - start).days }} days</td>
</tr>
{% endfor %}
<thead>
<tr>
<th>before</th>
<th class="text-end">start</th>
<th class="text-end">end</th>
<th class="text-end">days</th>
<th>after</th>
</tr>
</thead>
<tbody>
{% for gap in gaps %}
<tr>
<td>{% for event in gap.before %}{% if not loop.first %}, {% endif %}{{ event.title or event.name }}{% endfor %}</td>
<td class="text-end">{{ gap.start.strftime("%A, %-d %b %Y") }}</td>
<td class="text-end">{{ gap.end.strftime("%A, %-d %b %Y") }}</td>
<td class="text-end">{{ (gap.end - gap.start).days }} days</td>
<td>{% for event in gap.after %}{% if not loop.first %}, {% endif %}{{ event.title or event.name }}{% endfor %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>