Add photo links to trip and day summaries

Enhance trip UI by adding photo links for authenticated
users. This provides quick access to relevant trip photos.
Closes: #184
This commit is contained in:
Edward Betts 2024-10-21 10:20:09 +01:00
parent 662808b545
commit 34d1ee3b30

View file

@ -84,7 +84,11 @@
{% endfor %}
</ul>
{% if end %}
<div>Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}</div>
<div>Dates: {{ display_date_no_year(trip.start) }} to {{ display_date_no_year(end) }}
{% if g.user.is_authenticated and trip.start <= today %}
<a href="https://photos.4angle.com/search?query=%7B%22takenAfter%22%3A%22{{trip.start}}T00%3A00%3A00.000Z%22%2C%22takenBefore%22%3A%22{{end}}T23%3A59%3A59.999Z%22%7D">photos</a>
{% endif %}
</div>
{% else %}
<div>Start: {{ display_date_no_year(trip.start) }} (end date missing)</div>
{% endif %}
@ -107,7 +111,13 @@
{{ conference_list(trip) }}
{% for day, elements in trip.elements_grouped_by_day() %}
<h4>{{ display_date_no_year(day) }}</h4>
<h4>{{ display_date_no_year(day) }}
{% if g.user.is_authenticated and day <= today %}
<span class="lead">
<a href="https://photos.4angle.com/search?query=%7B%22takenAfter%22%3A%22{{day}}T00%3A00%3A00.000Z%22%2C%22takenBefore%22%3A%22{{day}}T23%3A59%3A59.999Z%22%7D">photos</a>
</span>
{% endif %}
</h4>
{% set accommodation_label = {"check-in": "check-in from", "check-out": "check-out by"} %}
{% for e in elements %}
{% if e.element_type in accommodation_label %}