]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/blobdiff - wrpylib/templates/sledrun_wikitext.txt
Nähere Details zu Rodelverleihs.
[philipp/winterrodeln/wrpylib.git] / wrpylib / templates / sledrun_wikitext.txt
index 895c1efa6a2e969972d8144851802f51e67daad9..bceb8b4241831594cdeda5f9a2e72f05fd55c32d 100644 (file)
@@ -5,6 +5,15 @@
 {%- 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 -%}
   {%- else %}
   {%- if walkup_possible is false %} (ein Aufstieg zu Fuß ist nicht möglich){% endif %}
   {%- endif %}
-* '''Beleuchtung''': {{ nightlight_description | default( nightlight_possible | default("''Unbekannt''") ) | trim }}
+* '''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 -%}
@@ -43,7 +67,7 @@
 {%- endif %}
 {%- endif -%}
 {% for rental in sled_rental %}
-** {% set space = joiner(" ") %}
+** {% 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 }}
    {%- 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.note %}{{ space() }}({{ rental.note }}){% 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) }}