From da3b1b0759686c7c78b410fb5518110efc756b2d Mon Sep 17 00:00:00 2001 From: eclipse Date: Fri, 14 Mar 2025 20:57:57 +0100 Subject: [PATCH] some code streamlining --- theme/templates/index.html | 2 +- theme/templates/termine.html | 10 +++++----- theme/templates/wide-cards.html | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/theme/templates/index.html b/theme/templates/index.html index 1562646..7903774 100644 --- a/theme/templates/index.html +++ b/theme/templates/index.html @@ -6,7 +6,7 @@ {% block content_body %} {% for p in pages if p.title == "Index" %} -{% if p.featured is defined %} +{% if p.featured %} {% endif %} diff --git a/theme/templates/termine.html b/theme/templates/termine.html index 451539a..9530aa9 100644 --- a/theme/templates/termine.html +++ b/theme/templates/termine.html @@ -1,6 +1,6 @@ {% extends "page.html" %} -{% if page.termine is defined %} +{% if page.termine %} {% set date_format = "%d.%m." %} {% set time_format = "%H:%M" %} @@ -31,11 +31,11 @@ {% for t in page.termine %} - {{ t.startdate | strftime(date_format) }}{% if t.enddate is defined %}–{{t.enddate | strftime(date_format) }}{% elif t.starttime is defined %} {{ t.starttime | strftime(time_format) }}{% endif %}
{{ t.location }} + {{ t.startdate | strftime(date_format) }}{% if t.enddate %}–{{t.enddate | strftime(date_format) }}{% elif t.starttime %} {{ t.starttime | strftime(time_format) }}{% endif %}
{{ t.location }}

{{ t.summary }} {% if "Moderation" in t.categories %}(Moderation){%endif%}

- {% if t.description is defined %}

{{ t.description | replace("\n\n", "

") | replace("\n", "
") | replace("


", "

")}}

{% endif %} - {% if t.attach is defined %}

Mehr Infos

{% endif %} + {% if t.description %}

{{ t.description | replace("\n\n", "

") | replace("\n", "
") | replace("


", "

")}}

{% endif %} + {% if t.attach %}

Mehr Infos

{% endif %} {% endfor %} @@ -45,7 +45,7 @@ {% endblock content_body %} {% block content_footer %} - {% if page.written_at is defined %} + {% if page.written_at %} diff --git a/theme/templates/wide-cards.html b/theme/templates/wide-cards.html index 6474f9e..8a16cf0 100644 --- a/theme/templates/wide-cards.html +++ b/theme/templates/wide-cards.html @@ -14,7 +14,7 @@ original order #} {% set wcards = [] %} {% for wide_card in page.wide_cards %} {% do wcards.append(pages | selectattr("slug", "==", wide_card) | list | first) if pages | selectattr("slug", "==", -wide_card) | list | first is defined %} +wide_card) | list | first %} {% endfor %} {# now we can finally iterate over the correct pages (max. 4 pages) #} {% for wcard in wcards[:4] %} @@ -23,13 +23,13 @@ wide_card) | list | first is defined %}

{{ wcard.title }}