some code streamlining

This commit is contained in:
eclipse 2025-03-14 20:57:57 +01:00
parent 4db6110e4b
commit da3b1b0759
3 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@
{% block content_body %} {% block content_body %}
{% for p in pages if p.title == "Index" %} {% for p in pages if p.title == "Index" %}
{% if p.featured is defined %} {% if p.featured %}
<div class="index-featured">not implemented yet</div> <div class="index-featured">not implemented yet</div>
{% endif %} {% endif %}

View File

@ -1,6 +1,6 @@
{% extends "page.html" %} {% extends "page.html" %}
{% if page.termine is defined %} {% if page.termine %}
{% set date_format = "%d.%m." %} {% set date_format = "%d.%m." %}
{% set time_format = "%H:%M" %} {% set time_format = "%H:%M" %}
@ -31,11 +31,11 @@
<tbody> <tbody>
{% for t in page.termine %} {% for t in page.termine %}
<tr> <tr>
<td class="event-info"><strong>{{ 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 %}</strong><br>{{ t.location }}</td> <td class="event-info"><strong>{{ t.startdate | strftime(date_format) }}{% if t.enddate %}{{t.enddate | strftime(date_format) }}{% elif t.starttime %} {{ t.starttime | strftime(time_format) }}{% endif %}</strong><br>{{ t.location }}</td>
<td class="event-detail"> <td class="event-detail">
<p>{{ t.summary }} {% if "Moderation" in t.categories %}(Moderation){%endif%}</p> <p>{{ t.summary }} {% if "Moderation" in t.categories %}(Moderation){%endif%}</p>
{% if t.description is defined %}<p>{{ t.description | replace("\n\n", "</p><p>") | replace("\n", "<br>") | replace("</p><br><p>", "</p><p>")}}</p>{% endif %} {% if t.description %}<p>{{ t.description | replace("\n\n", "</p><p>") | replace("\n", "<br>") | replace("</p><br><p>", "</p><p>")}}</p>{% endif %}
{% if t.attach is defined %}<p><a href="{{ t.attach }}" target="_blank" title="siehe auch …">Mehr Infos</a></p>{% endif %} {% if t.attach %}<p><a href="{{ t.attach }}" target="_blank" title="siehe auch …">Mehr Infos</a></p>{% endif %}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -45,7 +45,7 @@
{% endblock content_body %} {% endblock content_body %}
{% block content_footer %} {% block content_footer %}
{% if page.written_at is defined %} {% if page.written_at %}
<footer class="content-footer"> <footer class="content-footer">
<p>Letzte Aktualisierung: {{ page.written_at | strftime("%d.%m.%Y, %H:%M Uhr") }}</p> <p>Letzte Aktualisierung: {{ page.written_at | strftime("%d.%m.%Y, %H:%M Uhr") }}</p>
</footer> </footer>

View File

@ -14,7 +14,7 @@ original order #}
{% set wcards = [] %} {% set wcards = [] %}
{% for wide_card in page.wide_cards %} {% for wide_card in page.wide_cards %}
{% do wcards.append(pages | selectattr("slug", "==", wide_card) | list | first) if pages | selectattr("slug", "==", {% 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 %} {% endfor %}
{# now we can finally iterate over the correct pages (max. 4 pages) #} {# now we can finally iterate over the correct pages (max. 4 pages) #}
{% for wcard in wcards[:4] %} {% for wcard in wcards[:4] %}
@ -23,13 +23,13 @@ wide_card) | list | first is defined %}
<h2><a href="{{ SITEURL }}/{{ wcard.slug | lower }}/" title="{{ wcard.summary | striptags }}">{{ wcard.title }}</a></h2> <h2><a href="{{ SITEURL }}/{{ wcard.slug | lower }}/" title="{{ wcard.summary | striptags }}">{{ wcard.title }}</a></h2>
</div> </div>
<div class="wcard-gallery"> <div class="wcard-gallery">
{% if wcard.card_images is defined %} {% if wcard.card_images %}
<div class="wcard-gallery-mask"> <div class="wcard-gallery-mask">
<ul> <ul>
{% for image in wcard.card_images %} {% for image in wcard.card_images %}
<li class="wcard-image" style="animation-delay: {{ loop.index0 * 5 }}s;"> <li class="wcard-image" style="animation-delay: {{ loop.index0 * 5 }}s;">
<a href="{{ SITEURL }}/{{ image.link }}"> <a href="{{ SITEURL }}/{{ image.link }}">
<img class="image-process-featured" src="{{ SITEURL }}/{{ image.pic }}" alt="{{ image.alt }}" {%- if image.y_offset is defined %} style="bottom: {{ image.y_offset }};" {% endif %} /> <img class="image-process-featured" src="{{ SITEURL }}/{{ image.pic }}" alt="{{ image.alt }}" {%- if image.y_offset %} style="bottom: {{ image.y_offset }};" {% endif %} />
</a> </a>
<div class="wcard-tooltip"> <div class="wcard-tooltip">
<p>{{ image.alt }}</p> <p>{{ image.alt }}</p>