Show links for train journeys

Closes: #79
This commit is contained in:
Edward Betts 2024-04-01 10:36:48 +01:00
parent f0c28d2440
commit ae630a8f68

View file

@ -101,8 +101,13 @@
{% endmacro %}
{% macro train_row(item) %}
{% set url = item.url %}
<div class="grid-item text-end">{{ item.depart.strftime("%a, %d %b %Y") }}</div>
<div class="grid-item">{{ item.from }} &rarr; {{ item.to }}</div>
<div class="grid-item">
{% if url %}<a href="{{ url }}">{% endif %}
{{ item.from }} &rarr; {{ item.to }}
{% if url %}</a>{% endif %}
</div>
<div class="grid-item">{{ item.depart.strftime("%H:%M") }}</div>
<div class="grid-item">
{% if item.arrive %}
@ -119,5 +124,11 @@
<em>redacted</em>
{% endif %}
</div>
<div class="grid-item"></div>
<div class="grid-item">
{% for leg in item.legs %}
{% if leg.url %}
<a href="{{ leg.url }}">[{{ loop.index }}]</a>
{% endif %}
{% endfor %}
</div>
{% endmacro %}