@page "/events"
@{
// Heading and intro come from the "events" page record; fall back to a sensible
// default only if that record is missing, so the page still renders.
var title = _page?.Title ?? "Termine";
}
@title
@title
@if (_page is not null && !string.IsNullOrWhiteSpace(_page.Body))
{
@Body
}
@if (_unavailable)
{
Die Termine sind gerade nicht erreichbar. Bitte später erneut versuchen.
}
else
{
@* The page body above is the intro; the page only adds the subscribe button. *@
Kalender abonnieren
Kommende Termine
@if (_upcomingEvents.Count == 0)
{
Zurzeit sind keine Termine geplant.
}
else
{
@foreach (var ev in _upcomingEvents)
{
@* No Href: a card linking to this very page would lead nowhere. *@
}
}
@* Past events matter rarely, so they wait folded up and compact: grouped by year,
then day, title and (if the event has one) the time per row. *@
@if (_pastEvents.Count > 0)
{
Vergangene Termine anzeigen (@_pastEvents.Count)
@foreach (var year in PastYears)
{
@year.Key
@foreach (var ev in year)
{
var time = EventDateFormat.PastTime(ev);
-
@EventDateFormat.PastDays(ev)
@ev.Title
@if (time.Length > 0)
{
@time
}
}
}
}
}