tracker
All repositories: gitoria
5.2 KB
// components/franchise.hl — `/franchises/:slug` (a franchise's index: its timelines, each a list of its titles) AND// `/timelines/:tslug` (one timeline, its franchise above it) — tracker.worldapi.org#19, mission 066. Each timeline has its own// sort toggle: "Timeline" (the in-world order, as edited) | "Release" (a movie by its release, a series by the release date of// its LAST episode — franchises.hl releaseKeyOf). A row: small poster, title (year), Movie/Series and the date the release// sort uses.//// ONE FLAT LIST of rows (a `head` row per timeline, then its `item` rows), not a nested for over timelines > titles: the same// proven shape as the show page's seasons (hybriel#86). Both orders of every timeline come with the page (`blocks`); a toggle// only rebuilds `rows` in the browser (`flatRows` is pure) — no request.parent './main.hl'import { appTitle } from '../lib/app.hl'import { franchisePage, pageOf, editorOf, flatRows } from '../lib/franchises.hl'slug = nulltslug = nullsession = nullcanEdit = editorOf(&session)data = pageOf(&slug, &tslug)found = data.kind != 'none'notFound = data.kind == 'none'isTimeline = data.kind == 'timeline'name = data.namesummary = data.summaryhasSummary = summary != ''hasFranchise = data.franchiseName != ''franchiseName = data.franchiseNamefranchiseHref = data.franchiseHrefeditHref = data.editHrefshowEdit = canEdit && isTimeline// tracker#20 (merge, mission 070): "Franchise | Star Trek", "Timeline | …" — the type word in its colour (styles.hl type-*)typeText = isTimeline ? 'Timeline' : 'Franchise'typeClass = isTimeline ? 'type-word type-timeline' : 'type-word type-franchise'blocks = data.blockshasBlocks = blocks.length > 0noBlocks = found && blocks.length == 0modes = {}namedHeads = !isTimelinerows = flatRows(&blocks, &modes, &namedHeads)__title = found ? name + ' — ' + appTitle : appTitle// Component styles use the shared theme variables.Style {franchisePage {display = 'block'}aFranchiseUp {display = 'inline-block'marginBottom = '.3rem'fontSize = '.85rem'fontWeight = '600'letterSpacing = '.04em'textTransform = 'uppercase'}pFranchiseSummary {margin = '-.3rem 0 1rem'color = 'var(--color-text)'}timelineBlocks {display = 'block'}timelineHead {display = 'flex'flexWrap = 'wrap'alignItems = 'center'gap = '.4rem .8rem'padding = '.8rem 0 .4rem'marginTop = '.6rem'}timelineTitle {flex = '1 1 12rem'minWidth = '0'display = 'flex'flexWrap = 'wrap'alignItems = 'baseline'gap = '.2rem .6rem'}aTimelineName {minWidth = '2.75rem'fontSize = '1.05rem'fontWeight = '600'color = 'var(--color-text-strong)'overflowWrap = 'anywhere'padding = '.7rem 0'margin = '-.7rem 0'}timelineCount {flex = 'none'fontSize = '.85rem'color = 'var(--color-text-muted)'}sortToggle {flex = 'none'display = 'flex'padding = '.15rem'background = 'var(--color-surface)'borderRadius = 'var(--radius-small)'}'button.sortbtn' {padding = '.25rem .7rem'fontSize = '.85rem'color = 'var(--color-text)'background = 'transparent'}'button.sortbtn.on' {color = 'var(--color-accent-text)'background = 'var(--color-accent)'}aTimelineItem {display = 'flex'alignItems = 'center'gap = '.8rem'padding = '.45rem 0'color = 'var(--color-text)'hover {textDecoration = 'none'filmTitle {color = 'var(--color-accent)'}}}}View {franchisePage { "data-kind" = data.kindif (notFound) {h1 { "Not found" }p { "This franchise or timeline doesn't exist." }}if (found) {if (hasFranchise) { a { id = "franchise-up" Style.aFranchiseUp href = franchiseHref franchiseName } }franchisesHead {h1 { class = "typed" typeWord { class = typeClass typeText } typeSep { "|" } typeName { name } }if (showEdit) { a { id = "timeline-edit" class = "button" href = editHref "Edit" } }}if (hasSummary) { p { Style.pFranchiseSummary summary } }if (noBlocks) { p { class = "muted" "No timelines yet." } }if (hasBlocks) {timelineBlocks {for (row of rows) {if (row.isHead) {timelineHead { "data-timeline" = row.idtimelineTitle {if (row.hasName) { a { Style.aTimelineName href = row.href row.name } }timelineCount { row.countText }}sortToggle { "aria-label" = "Sort"button { type = "button" class = row.timelineClass value = "timeline" "Timeline" on click(e) { emit sortTimeline(row.id, 'timeline') } }button { type = "button" class = row.releaseClass value = "release" "Release" on click(e) { emit sortTimeline(row.id, 'release') } }}}}if (row.isItem) {a { Style.aTimelineItem href = row.href "data-timeline" = row.timelineimg { class = "film-poster" src = row.posterUrl alt = "" loading = "lazy" }filmText {filmTitle { row.title }filmMeta {span { class = row.typeClass row.typeLabel }span { class = "timeline-date" row.dateLabel }}}}}}}}}}}on sortTimeline(timelineId, mode) {m = modesm[timelineId] = modemodes = mrows = flatRows(&blocks, &modes, &namedHeads)}
Branches
Latest commits
- d0c083fbLog: usage stopmre
- c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
- 1eb6f1a1Missions AP56, BS1mre
- 4871f8adLog: AP52 live on day52, browser gate greenmre
- d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
- c4a60ef2Log: RT52 retest passed, AP52 startedmre
- 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
- 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
- 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
- ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
- 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
- 7c051eddLog: hybriel#338 answermre
- d049b8b8Log: HM50 live, #52 donemre
- 6d05fa37Log: HM50 Part A mergedmre
- 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
- e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
- 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
- 2f391aa9Log: HM50 startedmre
- 4b59c03dHM50 mission: doc pathmre
- ed526d67HM50 missionmre