]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Adjust whitespace for public transport.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 7 Jun 2022 21:51:16 +0000 (23:51 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Tue, 7 Jun 2022 21:51:16 +0000 (23:51 +0200)
wrpylib/templates/sledrun_wikitext.txt

index 1d4cc76649502998bf53e112eb707706ba19dcc4..6f151823476ccb8bf339d58c28dc5e0034928d1d 100644 (file)
@@ -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'] -%}
 {% 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 %}