From ae630a8f6859b14409fcddec6a678e3b45d4f4ae Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 1 Apr 2024 10:36:48 +0100 Subject: [PATCH] Show links for train journeys Closes: #79 --- templates/macros.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/templates/macros.html b/templates/macros.html index 1ce9ec8..d0cd0ab 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -101,8 +101,13 @@ {% endmacro %} {% macro train_row(item) %} + {% set url = item.url %}
{{ item.depart.strftime("%a, %d %b %Y") }}
-
{{ item.from }} → {{ item.to }}
+
+ {% if url %}{% endif %} + {{ item.from }} → {{ item.to }} + {% if url %}{% endif %} +
{{ item.depart.strftime("%H:%M") }}
{% if item.arrive %} @@ -119,5 +124,11 @@ redacted {% endif %}
-
+
+ {% for leg in item.legs %} + {% if leg.url %} + [{{ loop.index }}] + {% endif %} + {% endfor %} +
{% endmacro %}