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

index f027a89938ca9387907f7ca636875b9b98f889de..f4c545058e6262bd322e8b0979891c020b611961 100644 (file)
 {%- endif -%}
 {% for rental in sled_rental %}
 ** {% set space = joiner(" ") %}
 {%- endif -%}
 {% for rental in sled_rental %}
 ** {% set space = joiner(" ") %}
-   {%- if rental.name %}{{ space() }}{{ rental.name }}{% endif %}
+   {%- 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.wr_page %}{{ space() }}{{ wr_page(rental.wr_page) }}{% endif %}
-   {%- if rental.weblink %}{{ space() }}{{ weblink(rental.weblink) }}{% 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 %}
 {%- endfor %}
 * '''Schneelage - Auskunft''':
    {%- if rental.note %}{{ space() }}({{ rental.note }}){% endif %}
 {%- endfor %}
 * '''Schneelage - Auskunft''':