dirty fix kalender

This commit is contained in:
L3D 2022-05-05 23:50:14 +02:00
parent 0324d0165d
commit 20357ef1ff
Signed by: l3d
GPG key ID: CD08445BFF4313D1

View file

@ -1,27 +1,26 @@
{#- HTML Calender Renderer for Startpage -#} {#- HTML Calender Renderer for Startpage -#}
{{- '\n ' -}} <!-- Flow Calendar -->
{%- set pages = site.query('/').include_undiscoverable(true).all() -%} {%- set pages = site.query('/').include_undiscoverable(true).all() -%}
{%- set counter = ['1'] -%} {%- set counter = ['1'] -%}
{%- for page in pages -%} {%- for page in pages -%}
{%- if page._path == this.calendar_name -%} {%- if page._path == this.calendar_name -%}
{%- for blk in page.dates.blocks|sort(attribute='start', reverse = False) -%} {%- for blk in page.dates.blocks|sort(attribute='ende', reverse = False) -%}
{%- if blk.start.strftime('%Y%m%d%H%M') > none|datetimeformat('yyyyMMddhhmm') -%} {%- if blk.start.strftime('%Y%m%d%H%M') > none|datetimeformat('yyyyMMddhhmm') -%}
{%- if loop.index == 1 -%} {%- if counter == ['1'] -%}
{{- '\n ' -}} <table class="template"> <table class="template">
{{- '\n ' -}} <thead> <thead>
{{- '\n ' -}} <tr> <tr>
{{- '\n ' -}} <th>Datum</th> <th>Datum</th>
{{- '\n ' -}} <th>Veranstaltung</th> <th>Veranstaltung</th>
{{- '\n ' -}} <th>Ort</th> <th>Ort</th>
{{- '\n ' -}} </tr> </tr>
{{- '\n ' -}} </thead> </thead>
{{- '\n ' -}} <tbody> <tbody>
{%- endif -%} {%- endif -%}
{%- if counter.append('1') -%} {%- if counter.append('X') -%}
{#- Counter zum zaehlen ob es mehr wie 1 Temrin gibt -#} {#- Counter zum zaehlen ob es mehr wie 1 Temrin gibt -#}
{%- endif -%} {%- endif -%}
{{- '\n ' -}} <tr> <tr>
{{- '\n ' -}} <th> <th>
{%- if blk.start.strftime('%d.%m') == blk.ende.strftime('%d.%m') -%} {%- if blk.start.strftime('%d.%m') == blk.ende.strftime('%d.%m') -%}
{{- '\n ' -}} {{- '\n ' -}}
{{ blk.start.strftime('%d.%m.%y %H') }} - {{ blk.ende.strftime('%H') }} Uhr {{ blk.start.strftime('%d.%m.%y %H') }} - {{ blk.ende.strftime('%H') }} Uhr
@ -40,7 +39,7 @@
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{%- endif -%} {%- endif -%}
{%- if counter|length < 2 and loop.index == 1 %} {%- if counter|length < 1 and loop.index == 1 %}
{{- '\n ' -}} <p><i>Leider derzeit noch keine neuen Termine geplant!</i></p> {{- '\n ' -}} <p><i>Leider derzeit noch keine neuen Termine geplant!</i></p>
{%- endif -%} {%- endif -%}
{%- endfor %} {%- endfor %}