Show exploration days before/after each conference on trip page

For each conference, calculate the number of free days available
before and after, relative to the trip boundary or adjacent
conference. Multi-conference trips show the gap between conferences
as "after" the first and "before" the second.

Closes #189

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Edward Betts 2026-04-23 14:29:29 +01:00
parent 3ba18f9019
commit 54e898bc11
3 changed files with 44 additions and 0 deletions

View file

@ -239,6 +239,16 @@
{% elif item.price and item.currency %}
<span class="badge bg-info text-nowrap">price: {{ item.price }} {{ item.currency }}</span>
{% endif %}
{% set free_days = conference_free_days.get(item.start | string) %}
{% if free_days %}
{% set days_before, days_after = free_days %}
{% if days_before > 0 %}
<span class="badge bg-secondary text-nowrap">{{ days_before }} day{{ 's' if days_before != 1 }} to explore before</span>
{% endif %}
{% if days_after > 0 %}
<span class="badge bg-secondary text-nowrap">{{ days_after }} day{{ 's' if days_after != 1 }} to explore after</span>
{% endif %}
{% endif %}
</p>
</div>
</div>