ese-website/_includes/program.njk

76 lines
2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---js
{
layout: "page.njk",
getLocalized: function(item) {
if (typeof item === "string") return item;
return item[this.ctx.lang];
},
toDate: function(dateStr) {
return new Date(dateStr);
}
}
---
{{ content | safe }}
{% for date, events in program %}
<section class="program-date">
<h2 id="{{ date }}">
{{ toDate(date).toLocaleDateString(lang, { weekday: 'long', month: 'short', day: 'numeric' }) }}
</h2>
<ul>
{% for event in events %}
<li class="timeslot">
<div class="timeslot-container">
<h3 id="{{date}}_{{loop.index}}">
{% if event.livestream %}{% icon "solid:video", title="Livestream" %}{% endif %}
{{ getLocalized(event.title) }}
</h3>
<div class="timeslot-time">
<span class="start">{{ event.start }}</span>
{% if event.end %}
<span class="end"> {{ event.end }}</span>
{% endif %}
<span class="full">{{ event.start }}{{ " " + event.end if event.end }}</span>
</div>
<p>{{ getLocalized(event.description) }}</p>
{% if event.annotation %}
<p class="annotation">
{% icon "solid:exclamation", title=("Notice" if lang == "en" else "Hinweis") %}
{{ getLocalized(event.annotation) }}
</p>
{% endif %}
{% if event.location %}
<p class="location">
{% icon "solid:location-dot", title=("Location" if lang == "en" else "Veranstaltungsort") %}
{{ getLocalized(event.location) }}
</p>
{% endif %}
{% if event.checkin_link %}
<a class="btn"
{% if event.checkin_link.startsWith("http") %}
href="{{ event.checkin_link }}"
target="_blank"
rel="noreferrer"
{% else %}
href="{{ event.checkin_link | locale_url }}"
{% endif %}
>
Check-in
</a>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
</section>
{% endfor %}
{% css %}
{% include "program.css" %}
{% endcss %}