Template:Category/Workshop itinerary/session-row

From Miniscope
Jump to: navigation, search

Per-session row for Template:Category/Workshop itinerary/day. Do not transclude directly outside the itinerary.

SMW's format=template calls this template once per Schedule entry subobject matched in the day-block #ask. The query projects only direct subobject properties (start/end/ location/TAs/groups) plus the parent page reference; parent-side fields (topic/type/presenter, plus the workshop's timezone offset) are fetched here via per-row #show on . The detour exists because SMW chain projections misalign per-row when multiple subobjects share a parent or chained value (see the day template for the full rationale).

Named-arg params (named=yes):

  • Parent — parent Workshop session page link (wikilink
 form), projected via ?-Has subobject=Parent. Used as
 the rendered row title.
  • ParentRaw — bare parent page name, projected via
 ?-Has subobject#-=ParentRaw. Feeds the per-row
 #show calls below for type/topic/presenter/offset.
  • Start — Has start date as HH:MM, projected
 in UTC by SMW (it normalizes Date values internally; the per-session
 offset stored by labki-datetime doesn't survive).
  • End — same projection (may be empty).
  • Label — Has entry label on the subobject, optional
 short suffix (e.g. "(Part 1)", "(Morning)") appended to the parent
 title to disambiguate multi-part deliveries on the itinerary.
  • Where — Has location on the subobject (may differ across
 deliveries — different rooms per group). Page-typed multi-value.
  • TAs — Has TA on the subobject. Page-typed multi-value
 (Category:Workshop organizer); rendered on its own meta line.
  • Groups — Has participant group(s) on the subobject,
 comma-joined wikilinks (unused in render; reserved for future
 link-rendering of group chips).
  • GroupsRaw — bare page name(s), used to #show
 each group's Display label for the chip text.

Per-row #show lookups (computed inline against ):

  • Has session type — drives the category-class switch
 and the type chip text.
  • Has session topic — optional one-line scannable topic
 shown below the title.
  • Has presenter — italicized meta line; page-typed
 multi-value, SMW renders as comma-joined wikilinks.
  • Has workshopHas timezone offset
 two-step chain via #show to recover the workshop's
 UTC offset, then routed through
 Template:Category/Workshop itinerary/local-time for local-time
 arithmetic.

Why we don't use SMW chain projections in the parent #ask: inverse-chain (?-Has subobject.X) and forward-chain (?Has X.Y) projections misalign per-row when multiple subobjects share a parent (or a chained value), so values from one row's parent silently leak into another row's slot. Per-row #show calls keyed on ParentRaw are slower per page render but reliably aligned.

Local-time conversion: Template:Category/Workshop itinerary/local-time takes Start/End plus the row's Offset arg and does pure integer arithmetic on H and i to shift the UTC time. Avoids Unix timestamps (server-TZ-dependent) and strtotime relative arithmetic (version-flaky on this stack).

Renders one row:

  1. Title (left) + group chip(s) + type chip (right, pinned via flex
 space-between so they don't drift with title length)
  1. Optional topic line — short scannable gist of the session
  2. Optional presenter line (italic) — comma-joined wikilinks when
 multi-value
  1. Optional location line — comma-joined wikilinks when multi-value
  2. Optional TA line — comma-joined wikilinks when multi-value

Presenter / location / TAs each render on their own line rather than collapsing onto a shared meta line: a multi-value Has presenter (common — most sessions are co-led) gets crowded next to a location on a single line, and stacking keeps the rhythm clean.

Wikilinks: the outer #ask runs WITHOUT link=none, so page-typed projections (Parent, presenter, location, TAs, groups) arrive here pre-wrapped in syntax. We emit them directly without re-wrapping.

Color coding: The outer <div> gets a category class derived from Type via #switch::

  • is-content — Lecture, Discussion, Q&A, Office Hours,
 Participant Presentations
  • is-practical — Lab, Hands-on Demo, Analysis, Assembly
 (and the Lab, Hands-on Demo / Hands-on Demo, Lab
 multi-value combinations, since those are common together)
  • is-meal — Coffee, Lunch, Dinner
  • is-social — Social
  • is-break — Break, Travel
  • is-other — anything unrecognized, including most
 multi-value combinations beyond the two listed above

CSS supplies a left-border stripe + tinted type chip per category. Color is supplementary — text labels still convey type, so a B&W printed handout doesn't lose information.