gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitbfc4ea4dbfc4ea4dMerge branch 'ap62' into mainTrackerbfc4ea4d/components/genre.hl

2.5 KB

  1. // components/genre.hl — `/genres/:genre`, `/genres/:genre/page/:page` (mission 058, tracker.worldapi.org#25): the /movies and
  2. // /shows list narrowed to one genre — its movies AND series together, newest first (catalog.hl genre lists: a movie by its
  3. // release, a series by its newest released episode), 24 per page, poster + title (+ year), adult titles hidden like there.
  4. // The creator: "/genres/:genre pages look like the shows and movies list page just narrowed to their genre but show both
  5. // movies and shows with that genre". The genre pills on a show page link here (`/genre/<x>` answers 301 to it, project.hl).
  6. // The grid and the pagination: components/tilelist.hl.
  7. parent './main.hl'
  8. import TileList from './tilelist.hl'
  9. import { appTitle } from '../lib/app.hl'
  10. import { genreOf, listingOf, countOf } from '../lib/catalog.hl'
  11. import { warmReady, warmText } from '../lib/warm.hl'
  12. genre = null
  13. page = null
  14. genreRow = genreOf(&genre)
  15. found = genreRow != null
  16. notFound = genreRow == null
  17. name = found ? genreRow.name : ''
  18. listing = listingOf(&genreRow, &page)
  19. tiles = listing.tiles
  20. pageNo = listing.page
  21. pageCount = listing.pages
  22. total = countOf(&genreRow)
  23. countText = total + (total == 1 ? ' title' : ' titles') + ', newest first · page ' + pageNo + ' of ' + pageCount
  24. hasTiles = total > 0
  25. noTiles = found && total == 0
  26. basePath = found ? '/genres/' + genreRow.urlSegment : '/genres'
  27. __title = found ? (pageNo > 1 ? name + ', page ' + pageNo + ' — ' + appTitle : name + ' — ' + appTitle) : appTitle
  28. // mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'catalog'
  29. // stage is there this page says so instead of showing half a map
  30. warming = !warmReady('catalog')
  31. warmNote = warming ? warmText() : ''
  32. View {
  33. listPage { id = "genre-page"
  34. if (warming) { p { id = "warming" class = "message banner" warmNote } }
  35. if (notFound) {
  36. h1 { "Not found" }
  37. p { "This genre doesn't exist." }
  38. }
  39. // tracker.worldapi.org#20: "Genre | Action", the type word in the genre colour, the name white
  40. if (found) { h1 { class = "typed" typeWord { class = "type-word type-genre" "Genre" } typeSep { "|" } typeName { name } } }
  41. if (noTiles) { p { class = "muted" "Nothing in this genre yet." } }
  42. if (hasTiles) { p { class = "muted list-count" countText } }
  43. // always there (no `if` around a composed component, like /movies): empty for an unknown genre, no pager on one page
  44. TileList { tiles = tiles page = pageNo pages = pageCount basePath = basePath }
  45. }
  46. }

Branches

Latest commits

  • bfc4ea4dMerge branch 'ap62' into mainTracker
  • 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker
  • b9c7c3c8Merge branch 'records-dp74' into mainTracker
  • 85cfb4ae|||PR records: AP61 day61, DP74 liveTracker
  • b1496147Merge branch 'ap61' into mainTracker
  • 2047955bMerge branch 'u12-gateports' into mainTracker
  • c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
  • 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
  • 0b86324aMerge branch 'records-dp73' into mainTracker
  • 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
  • 613ae0ecMerge branch 'bs3' into mainTracker
  • 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
  • 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
  • 310613f1Merge branch 'records-dp72' into mainTracker
  • 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
  • c41587d2Merge branch 'bs2' into mainTracker
  • 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
  • 019d5cedMerge branch 'records-1110' into mainTracker
  • f88ae8b9|||PR records: day56 toggle live, reviewTracker
  • b6b3bb4dMerge branch 'ap56e' into mainTracker