tracker
All repositories: gitoria
2.8 KB
// components/genre.hl — `/genres/:genre`, `/genres/:genre/page/:page` (mission 058, tracker.worldapi.org#25): the /movies and// /shows list narrowed to one genre — its movies AND series together, newest first (catalog.hl genre lists: a movie by its// release, a series by its newest released episode), 24 per page, poster + title (+ year), adult titles hidden like there.// The creator: "/genres/:genre pages look like the shows and movies list page just narrowed to their genre but show both// movies and shows with that genre". The genre pills on a show page link here (`/genre/<x>` answers 301 to it, project.hl).// The grid and the pagination: components/tilelist.hl.parent './main.hl'import TileList from './tilelist.hl'import { appTitle } from '../project.hl'import { genreBySlug } from '../lib/shows.hl'import { genrePage, genreCount } from '../lib/catalog.hl'import { warmReady, warmText } from '../lib/warm.hl'// static: an mpackdb-backed helper must be `static` (hybriel#115/#116)static genreOf = (&slug) => { return genreBySlug(slug) }static listingOf = (&g, &raw) => { return g != null ? genrePage(g.id, raw) : { page = 1 pages = 1 tiles = [] } }static countOf = (&g) => { return g != null ? genreCount(g.id) : 0 }genre = nullpage = nullgenreRow = genreOf(genre)found = genreRow != nullnotFound = genreRow == nullname = found ? genreRow.name : ''listing = listingOf(genreRow, page)tiles = listing.tilespageNo = listing.pagepageCount = listing.pagestotal = countOf(genreRow)countText = total + (total == 1 ? ' title' : ' titles') + ', newest first · page ' + pageNo + ' of ' + pageCounthasTiles = total > 0noTiles = found && total == 0basePath = found ? '/genres/' + genreRow.urlSegment : '/genres'__title = found ? (pageNo > 1 ? name + ', page ' + pageNo + ' — ' + appTitle : name + ' — ' + appTitle) : appTitle// mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'catalog'// stage is there this page says so instead of showing half a mapwarming = !warmReady('catalog')warmNote = warming ? warmText() : ''View {listPage { id = "genre-page"if (warming) { p { id = "warming" class = "message banner" warmNote } }if (notFound) {h1 { "Not found" }p { "This genre doesn't exist." }}// tracker.worldapi.org#20: "Genre | Action", the type word in the genre colour, the name whiteif (found) { h1 { class = "typed" typeWord { class = "type-word type-genre" "Genre" } typeSep { "|" } typeName { name } } }if (noTiles) { p { class = "muted" "Nothing in this genre yet." } }if (hasTiles) { p { class = "muted list-count" countText } }// always there (no `if` around a composed component, like /movies): empty for an unknown genre, no pager on one pageTileList { tiles = tiles page = pageNo pages = pageCount basePath = basePath }}}
Branches
Latest commits
- 0ff4ecd4Tracker: RV28c briefmre
- 06565b1fRecords: day35 relay note, tickets subscription idmre
- c6dc3e86RV28b: switch to set day35mre
- 24e401b8Tracker: TR7 watch cleanmre
- b0412957Tracker: RV28b handed overmre
- 456940c8Tracker: RULINGS pathmre
- b87a8fdcTracker: worldapi-conductor paths backmre
- 641f3b54Tracker: Apollo answermre
- 8b3cbddaTracker: status, TR7 fix livemre
- ec30162aTracker: TR7 fix livemre
- 54cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre
- 3e164b63Tracker: status after CL1mre
- 9d686bb3Tracker: CL1 reviewedmre
- b8bba562CL1: crash loop report (SIGPIPE confirmed, trap wrapper option)mre
- 298785f2Tracker: CL1 startedmre
- 36b22710Tracker: port slot, CL1 briefmre
- a401190fTracker: GO for the crash loopmre
- e195d372Tracker: token pathsmre
- 7f541d11Tracker conductor: CONDUCTOR.md, short STATUS.md, old status + decisions archive to archive/2026-10-31mre
- 8dd423f7README: login.js stays by caramboleyo's explicit rulemre