map_json = json.loads(map_json_page.text)
else:
map_json = None
- text = create_sledrun_wiki(sledrun_json, map_json)
+ impressions = None
+ sledrun_impressions_page = Page(self.site, self.current_page.title() + '/Impressionen')
+ if sledrun_impressions_page.exists():
+ impressions = sledrun_impressions_page.title()
+ text = create_sledrun_wiki(sledrun_json, map_json, impressions)
summary = 'Rodelbahnbeschreibung von aus JSON Daten aktualisiert.'
self.put_current(text, summary=summary)
sledrun_json['allow_reports'] = True
- text = create_sledrun_wiki(sledrun_json, map_json)
+ impressions = None
+ sledrun_impressions_page = Page(self.site, self.current_page.title() + '/Impressionen')
+ if sledrun_impressions_page.exists():
+ impressions = sledrun_impressions_page.title()
+
+ text = create_sledrun_wiki(sledrun_json, map_json, impressions)
summary = 'Rodelbahnbeschreibung nach Konvertierung nach und von JSON.'
self.put_current(text, summary=summary)
{%- if position %}|Wetter=Ja{% endif -%}
{%- if videos %}|Video={{ videos[0].url }} {% endif -%}
|Korrektur=Seite{% if correction_email %}|Korrektur_To={{ correction_email }}{% endif -%}
+{% if impressions_title %}|Impressionen={{ impressions_title }}{% endif -%}
{% if freizeitticket_tyrol %}|Freizeitticket=Ja{% endif -%}
{% if regio_card_tyrol %}|Regiocard=Ja{% endif -%}}}
{% raw %}{{Clear}}{% endraw %}
return str(wrpylib.mwmarkup.create_template(value['name'], args, kwargs))
-def create_sledrun_wiki(sledrun_json: Dict, map_json: Optional[Dict]) -> str:
+def create_sledrun_wiki(sledrun_json: Dict, map_json: Optional[Dict], impressions_title: Optional[str] = None) -> str:
env = jinja2.Environment(
loader=jinja2.PackageLoader("wrpylib"),
autoescape=jinja2.select_autoescape(),
return template.render(sledrun_json=sledrun_json,
rodelbahnbox=rodelbahnbox,
- map_json=map_json, h=Jinja2Tools(), **sledrun_json)
+ map_json=map_json, impressions_title=impressions_title,
+ h=Jinja2Tools(), **sledrun_json)