From 17cf271b6502eef3f0067faf3d56d55807d0255f Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Tue, 7 Jun 2022 23:51:16 +0200 Subject: [PATCH] Adjust whitespace for public transport. --- wrpylib/templates/sledrun_wikitext.txt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/wrpylib/templates/sledrun_wikitext.txt b/wrpylib/templates/sledrun_wikitext.txt index 1d4cc76..6f15182 100644 --- a/wrpylib/templates/sledrun_wikitext.txt +++ b/wrpylib/templates/sledrun_wikitext.txt @@ -84,8 +84,9 @@ {{ public_transport_description | trim }} {%- else -%} ''Hier wird die Anreise mit öffentlichen Verkehrsmitteln beschrieben.'' -{% endif %} -{% for pt_stop in public_transport_stops %} +{%- endif %} + +{% for pt_stop in public_transport_stops -%} * {{ h.list_template('Haltestelle', [pt_stop.municipality, pt_stop.name_local, h.json_pos_ele_position(pt_stop.get('position', {})), h.json_pos_ele_elevation(pt_stop.get('position', {}))]) }} {%- if pt_stop.note %} ({{ pt_stop.note }}){% endif %} {% for template_name in ['monitor_template', 'route_arrival_template', 'route_departure_template'] -%} @@ -94,17 +95,14 @@ {% endif %} {%- endfor %} {%- endfor -%} -{% for pt_line in public_transport_lines -%} -{% if loop.first -%} +{% if public_transport_lines|length + public_transport_links|length > 0 -%} * '''Fahrplan''': -{%- endif %} +{% endif -%} +{% for pt_line in public_transport_lines -%} ** {% if pt_line.timetable_template is defined %}{{ h.json_template(pt_line.timetable_template) }} {%- else %}{{ pt_line.name }}{% endif %} -{%- endfor -%} +{% endfor -%} {% for link in public_transport_links -%} -{% if loop.first -%} -* '''Fahrplan''': -{%- endif %} ** {{ weblink(link) }} {%- endfor %} -- 2.39.5