X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/blobdiff_plain/59de1a776c2e96d1bf51fcbfe44214638cddadef..30451a1ba4c0f5c76cd0977c4fe12b70aa32cd19:/wrpylib/templates/sledrun_wikitext.txt diff --git a/wrpylib/templates/sledrun_wikitext.txt b/wrpylib/templates/sledrun_wikitext.txt index 5e70760..bceb8b4 100644 --- a/wrpylib/templates/sledrun_wikitext.txt +++ b/wrpylib/templates/sledrun_wikitext.txt @@ -5,51 +5,128 @@ {%- macro wr_page(value) -%} [[{{ value.title }}{% if value.text %}|{{ value.text }}{% endif %}]] {%- endmacro -%} +{%- macro address(value) -%} +{% set space = joiner(" ") %} +{%- if value.street %}{{ space() }}{{ value.street }}{% endif %} +{%- if value.housenumber %}{{ space() }}{{ value.housenumber }}{% endif %} +{%- if value.street or value.housenumber %};{% endif %} +{%- if value.postcode %}{{ space() }}{{ value.postcode }}{% endif %} +{%- if value.city %}{{ space() }}{{ value.city }}{% endif %} +{%- if value.country %}{{ space() }}{{ value.country }}{% endif %} +{%- endmacro -%} +{% if sledrun_json.entry_under_construction %}{% raw %}{{In Arbeit|Rodelbahn}}{% endraw %} + +{% endif -%} == Allgemeines == {{ rodelbahnbox }} {{ description | default("''Hier wird die Rodelbahn allgemein beschrieben.''") | trim }} +{%- if sledrun_json.tiroler_naturrodelbahn_gütesiegel %} +{% set gs = sledrun_json.tiroler_naturrodelbahn_gütesiegel %} +{{ h.key_value_template('Tiroler Naturrodelbahn Gütesiegel', { + 'Erstverleihung': gs.get('first_issued'), + 'Verlängerung': gs.get('valid_from'), + 'Forum': gs.get('forum_id'), + 'Thread': gs.get('thread_id'), + 'Anlagename': gs.get('name'), + 'Organisation': gs.get('organization'), +}) }} +{%- endif %} {% raw %} * {{Position oben}} * {{Position unten}} * {{Höhenunterschied}} * {{Bahnlänge}} -* {{Gehzeit}} -{% endraw -%} -* '''Beleuchtung''': {{ nightlight_description | default( nightlight_possible | default("''Unbekannt''") ) | trim }} -* '''Rodelverleih''': {{ sled_rental_description | default( sled_rental_direct | german_bool | default("''Unbekannt''") ) | trim }} +* {{Gehzeit}}{% endraw %} + {%- if walkup_time_note %} ({{ walkup_time_note }}) + {%- else %} + {%- if walkup_possible is false %} (ein Aufstieg zu Fuß ist nicht möglich){% endif %} + {%- endif %} +* '''Beleuchtung''': {% if nightlight_description -%} + {{ nightlight_description }} + {%- else %} + {%- if nightlight_possible -%} + {{ nightlight_possible }} + {%- if nightlight_weekdays %} ( + {%- if nightlight_weekdays|length == 7 -%} + täglich + {%- else -%} + {{ ', '.join(nightlight_weekdays) }} + {%- endif -%} + ){% endif %} + {%- else -%} + ''Unbekannt'' + {%- endif %} + {%- endif %} +* '''Rodelverleih''': {% if sled_rental_description -%} +{{ sled_rental_description | trim }} +{%- else -%} +{% if sled_rental -%} +{% if sled_rental|length == 0 %}Nein{% endif %} +{%- else -%} +{{ sled_rental_direct | german_bool | default("''Unbekannt''") }} +{%- endif %} +{%- endif -%} +{% for rental in sled_rental %} +** {% set space = joiner("; ") %} + {%- if rental.name %}{{ space() }} + {%- if rental.weblink and not rental.weblink.text %}{{ weblink({"url": rental.weblink.url, "text": rental.name}) }} + {%- else %}{{ rental.name }} + {%- endif %} + {%- endif %} + {%- if rental.wr_page %}{{ space() }}{{ wr_page(rental.wr_page) }}{% endif %} + {%- if rental.weblink and not (rental.name and not rental.weblink.text) %} + {{- space() }}{{ weblink(rental.weblink) }}{% endif %} + {%- if rental.phone %}{{ space() }}Tel. {{ rental.phone }}{% endif %} + {%- if rental.address %}{{ space() }}{{ address(rental.address) }}{% endif %} + {%- if rental.location %}{{ space() }}{{ rental.location }}{% endif %} + {%- if rental.opening_hours %}{{ space() }}{{ rental.opening_hours }}{% endif %} + {%- if rental.note %}{{ space() }}{{ rental.note }}{% endif %} +{%- endfor %} * '''Schneelage - Auskunft''': {%- for info in info_phone %} -** {{ info.phone }} ({{ info.name }}) +** {{ info.phone }} ({{ info.name }}{% if info.note %}; {{ info.note }}{% endif %}) {%- endfor %} {%- for info in info_web %} ** {{ weblink(info) }} {%- endfor %} -* '''Betreiber''': {{ operator }} -* '''Hütten''': +* '''Betreiber''': +{%- if has_operator is defined %} {% if has_operator %}{{ operator }}{% else %}''Nein''{% endif %}{% endif %} +* '''Hütten''': {{ gastronomy_description }} {%- for info in gastronomy %} -** {{ info.name }} - {%- if info.wr_page %}{{ wr_page(info.wr_page) }}{% endif %} - {%- if info.weblink %}{{ weblink(info.weblink) }}{% endif %} - {%- if info.note %} ({{ info.note }}){% endif %} +** {% set space = joiner(" ") %} + {%- if info.name %}{{ space() }} + {%- if info.weblink and not info.weblink.text %}{{ weblink({"url": info.weblink.url, "text": info.name}) }} + {%- else %}{{ info.name }} + {%- endif %} + {%- endif %} + {%- if info.wr_page %}{{ space() }}{{ wr_page(info.wr_page) }}{% endif %} + {%- if info.weblink and not (info.name and not info.weblink.text) %} + {{- space() }}{{ weblink(info.weblink) }}{% endif %} + {%- if info.note %}{{ space() }}({{ info.note }}){% endif %} {%- endfor %} * '''Andere Rodelbahnen''': -{% for info in sledrun_list %} +{%- for info in sledrun_list %} ** {{ wr_page(info) }} -{% endfor -%} +{%- endfor %} * '''Siehe auch''': {%- for info in see_also %} ** {{ weblink(info) }} {%- endfor %} -{% raw %}{{Buttonleiste{% endraw -%} -|Bericht={{ allow_reports | default(true) | german_bool }} -{%- if forum_id %}|ForumId={{ forum_id }}{% endif -%} -{% if impressions_title %}|Impressionen={{ impressions_title }}{% endif -%} -{%- if position %}|Wetter=Ja{% endif -%} -{%- if videos %}|Video={{ videos[0].url }}{% endif -%} -|Korrektur=Seite{% if correction_email %}|Korrektur_To={{ correction_email }}{% endif -%} -{% if freizeitticket_tyrol %}|Freizeitticket=Ja{% endif -%} -{% if regio_card_tyrol %}|Regiocard=Ja{% endif -%}}} +{{ h.key_value_template('Buttonleiste', { + 'Bericht': allow_reports|german_bool, + 'ForumId': forum_id, + 'Gütesiegel': tiroler_naturrodelbahn_gütesiegel.thread_id if tiroler_naturrodelbahn_gütesiegel else '', + 'Impressionen': impressions_title, + 'Wetter': 'Ja' if position else '', + 'webcam': webcams[0].url if webcams and webcams|length > 0 else '', + 'video': videos[0].url if videos and videos|length > 0 else '', + 'Korrektur': 'Seite', + 'Korrektur_To': correction_email, + 'Korrektur_To_Name': correction_name, + 'Freizeitticket': 'Ja' if freizeitticket_tyrol else '', + 'Regiocard': 'Ja' if regio_card_tyrol else '', +}) }} {% raw %}{{Clear}}{% endraw %} @@ -66,11 +143,16 @@ {% if public_transport_description -%} {{ public_transport_description | trim }} {%- else -%} +{% if public_transport == "Nein" -%} +Leider ist keine Anreise mit öffentlichen Verkehrsmitteln möglich. +{%- else -%} ''Hier wird die Anreise mit öffentlichen Verkehrsmitteln beschrieben.'' {%- endif %} +{%- 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', {}))]) }} +* {{ h.list_template('Haltestelle', [pt_stop.get('municipality', pt_stop.get('name', '')), pt_stop.get('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'] -%} {% if template_name in pt_stop -%} @@ -78,20 +160,23 @@ {% 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 %} -** {% if pt_line.timetable_template is defined %}{{ h.json_template(pt_line.timetable_template) }} - {%- else %}{{ pt_line.name }}{% endif %} -{%- endfor %} +{% for pt_line in public_transport_lines -%} +** {% set space = joiner(" ") %} + {%- if pt_line.name %}{{ space() }}{{ pt_line.name }} + {%- else %} + {%- if pt_line.label %}{{ space() }}{{ pt_line.label }}{% endif %} + {%- endif %} + {%- if pt_line.timetable_template %}{{ space() }}{{ h.json_template(pt_line.timetable_template) }}{% endif %} + {%- if pt_line.route %}{{ space() }}{{ pt_line.route }}{% endif %} + {%- if pt_line.note %}{{ space() }}{{ pt_line.note }}{% endif %} + {%- for tl in pt_line.timetable_links %}{{ space() }}{{ weblink(tl) }}{% endfor %} +{% endfor -%} {% for link in public_transport_links -%} -{% if loop.first -%} -* '''Fahrplan''': -{%- endif %} ** {{ weblink(link) }} -{%- endfor %} - +{% endfor %} +{% endif %} == Anreise mit dem Auto == {% if car_description -%} {{ car_description | trim }} @@ -110,7 +195,8 @@ ** {{ distance_info.route }}: {{ distance_info.km }} km {% endfor %} -{% raw %}{{Rodelbahnzustand|Forumlink={% endraw %}{{ sledrun_json.forum_id }}}} +{{ h.key_value_template('Rodelbahnzustand', {'Forumlink': sledrun_json.forum_id}) }} [[Kategorie:Rodelbahn]] +{% if sledrun_json.entry_under_construction %}[[Kategorie:In Arbeit]]{% endif -%} {% endblock %}