Schedule: optional title per tour and sold-out status

A tour's own title (per language) replaces its page's title on the
card; status: soldout marks it as fully booked. Both are written by
the Hackertours-Admin website sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Stefan Bethke 2026-10-16 19:04:05 +02:00
commit ba3e79a957
5 changed files with 44 additions and 3 deletions

View file

@ -76,16 +76,26 @@ so an hour without tours still gets a row.
{{- $seen = merge $seen (dict .time (add $nth 1)) }}
{{- $page := $.Page.GetPage .tour }}
{{- if not $page }}{{ warnf "schedule: %s: no page for tour %q on day %v" $event .tour $day.day }}{{ end }}
<li class="schedule__card" style="--schedule-row: {{ add (index $slotRow .time) $nth }}">
{{- $entry := . }}
{{- $soldOut := eq .status "soldout" }}
{{- /* A tour's own title, in the page's language, replaces its page's title. */}}
{{- $ownTitle := "" }}
{{- with .title }}{{ $ownTitle = index . site.Language.Name | default (index . "en") }}{{ end }}
<li class="schedule__card{{ if $soldOut }} schedule__card--soldout{{ end }}" style="--schedule-row: {{ add (index $slotRow .time) $nth }}">
<span class="schedule__when">
<time class="schedule__time" datetime="{{ $day.date }}T{{ .time }}">{{ .time }}</time>
{{- if $soldOut }}
<span class="schedule__status">{{ i18n "schedule_soldout" }}</span>
{{- end }}
</span>
{{- with .lang }}
<span class="schedule__langs">{{ range (cond (reflect.IsSlice .) . (slice .)) }}{{ partial "lang-badge.html" (dict "code" . "class" "schedule__lang") }}{{ end }}</span>
{{- end }}
{{- with $page }}
{{- $title := .LinkTitle | replaceRE $prefix "" }}
{{- $title := $ownTitle | default (.LinkTitle | replaceRE $prefix "") }}
<a class="schedule__title" href="{{ .RelPermalink }}" title="{{ $title }}">{{ $title }}</a>
{{- else }}
<span class="schedule__title">{{ .tour }}</span>
<span class="schedule__title">{{ $ownTitle | default $entry.tour }}</span>
{{- end }}
</li>
{{- end }}