From a203d3cd385d1829f39cbe296ff209013c59dc37 Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Mon, 6 Jun 2022 17:37:59 +0200 Subject: [PATCH] Create "Buttonleiste" with key_value_template. --- wrpylib/templates/sledrun_wikitext.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/wrpylib/templates/sledrun_wikitext.txt b/wrpylib/templates/sledrun_wikitext.txt index 110fb3d..13febab 100644 --- a/wrpylib/templates/sledrun_wikitext.txt +++ b/wrpylib/templates/sledrun_wikitext.txt @@ -55,15 +55,17 @@ ** {{ 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, + 'Impressionen': impressions_title, + 'Wetter': 'Ja' if position else '', + 'video': videos[0].url if videos and videos|length > 0 else '', + 'Korrektur': 'Seite', + 'Korrektur_To': correction_email, + 'Freizeitticket': 'Ja' if freizeitticket_tyrol else '', + 'Regiocard': 'Ja' if regio_card_tyrol else '', +}) }} {% raw %}{{Clear}}{% endraw %} -- 2.39.5