]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
If a gastronomy has a link without text, put the link below the name.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 3 Jul 2022 21:44:05 +0000 (23:44 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 3 Jul 2022 21:44:05 +0000 (23:44 +0200)
wrpylib/templates/sledrun_wikitext.txt

index f4c545058e6262bd322e8b0979891c020b611961..ca88e969906fbf32def5f9bebc7d1cdf52a66b3d 100644 (file)
 * '''Hütten''': {{ gastronomy_description }}
 {%- for info in gastronomy %}
 ** {% set space = joiner(" ") %}
 * '''Hütten''': {{ gastronomy_description }}
 {%- for info in gastronomy %}
 ** {% set space = joiner(" ") %}
-   {%- if info.name %}{{ space() }}{{ info.name }}{% endif %}
+   {%- 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.wr_page %}{{ space() }}{{ wr_page(info.wr_page) }}{% endif %}
-   {%- if info.weblink %}{{ space() }}{{ weblink(info.weblink) }}{% 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''':
    {%- if info.note %}{{ space() }}({{ info.note }}){% endif %}
 {%- endfor %}
 * '''Andere Rodelbahnen''':