From: Philipp Spitzer Date: Sun, 3 Jul 2022 21:43:50 +0000 (+0200) Subject: If a sled rental has a link without text, put the link below the name. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/f2e19458d3c1a6f47a17184f85bcab1c787f538f If a sled rental has a link without text, put the link below the name. --- diff --git a/wrpylib/templates/sledrun_wikitext.txt b/wrpylib/templates/sledrun_wikitext.txt index f027a89..f4c5450 100644 --- a/wrpylib/templates/sledrun_wikitext.txt +++ b/wrpylib/templates/sledrun_wikitext.txt @@ -44,9 +44,14 @@ {%- 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.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''':