diff --git a/README.md b/README.md index fbc1417..1df165e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ days: - `tour` is the slug of the tour page in the event section. The card shows that page's title, without the event prefix, and links to it. - `lang` is `de`, `en` or `deen`, or a list of these. It renders the same badge as the `lang` shortcode. - `time` is `HH:MM` with a leading zero (`09:30`). Tours are sorted by time, so their order in the file doesn't matter. +- `title` (optional) replaces the page's title on the card, with one entry per language: `title: { de: "Hafen am Abend", en: "Harbour by Night" }`. +- `status` (optional): `soldout` marks the tour as fully booked. Other values are ignored. + +For the events managed with Hackertours-Admin, the data file is generated by its website sync; don't edit it by hand. Wide screens get one column per day on an hour grid, with tours that start at the same time side by side. The first column shows the hour wherever the first day has no tour in it. On narrow screens a day picker shows one day at a time, starting with today's day during the event. diff --git a/assets/css/_schedule.css b/assets/css/_schedule.css index c9f51f6..6e812f4 100644 --- a/assets/css/_schedule.css +++ b/assets/css/_schedule.css @@ -126,6 +126,31 @@ } } +.schedule__when { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 0 0.5rem; +} + +.schedule__status { + font-family: var(--ff-alt); + font-size: var(--fs-xs); + font-weight: bold; + letter-spacing: 0.03em; + text-transform: uppercase; + color: var(--color-text-meta); +} + +/* Fully booked: still listed and linked, but muted. */ +.schedule__card--soldout { + border-inline-start-color: var(--schedule-line); + + & .schedule__title { + color: var(--color-text-meta); + } +} + .schedule__time { font-family: var(--ff-alt); font-size: var(--fs-s); diff --git a/i18n/de.yaml b/i18n/de.yaml index 52933af..3ad0816 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -1,2 +1,3 @@ schedule_day: "Tag {{ .Day }}" schedule_pick_day: "Tag auswählen" +schedule_soldout: "ausgebucht" diff --git a/i18n/en.yaml b/i18n/en.yaml index 37d2ea0..7de61d2 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1,2 +1,3 @@ schedule_day: "Day {{ .Day }}" schedule_pick_day: "Choose a day" +schedule_soldout: "fully booked" diff --git a/layouts/_shortcodes/schedule.html b/layouts/_shortcodes/schedule.html index 1a238ed..ed4c9f1 100644 --- a/layouts/_shortcodes/schedule.html +++ b/layouts/_shortcodes/schedule.html @@ -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 }} -
  • +{{- $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 }} +
  • + +{{- if $soldOut }} +{{ i18n "schedule_soldout" }} +{{- end }} + {{- with .lang }} {{ range (cond (reflect.IsSlice .) . (slice .)) }}{{ partial "lang-badge.html" (dict "code" . "class" "schedule__lang") }}{{ end }} {{- end }} {{- with $page }} -{{- $title := .LinkTitle | replaceRE $prefix "" }} +{{- $title := $ownTitle | default (.LinkTitle | replaceRE $prefix "") }} {{ $title }} {{- else }} -{{ .tour }} +{{ $ownTitle | default $entry.tour }} {{- end }}
  • {{- end }}