gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitfdf10b1afdf10b1alog: RV28d deployed on day38bmrefdf10b1a/components/genre.hl

2.8 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 '../project.hl'
  10. import { genreBySlug } from '../lib/shows.hl'
  11. import { genrePage, genreCount } from '../lib/catalog.hl'
  12. import { warmReady, warmText } from '../lib/warm.hl'
  13. // static: an mpackdb-backed helper must be `static` (hybriel#115/#116)
  14. static genreOf = (&slug) => { return genreBySlug(&slug) }
  15. static listingOf = (&g, &raw) => { return g != null ? genrePage(&g.id, &raw) : { page = 1 pages = 1 tiles = [] } }
  16. static countOf = (&g) => { return g != null ? genreCount(&g.id) : 0 }
  17. genre = null
  18. page = null
  19. genreRow = genreOf(&genre)
  20. found = genreRow != null
  21. notFound = genreRow == null
  22. name = found ? genreRow.name : ''
  23. listing = listingOf(&genreRow, &page)
  24. tiles = listing.tiles
  25. pageNo = listing.page
  26. pageCount = listing.pages
  27. total = countOf(&genreRow)
  28. countText = total + (total == 1 ? ' title' : ' titles') + ', newest first · page ' + pageNo + ' of ' + pageCount
  29. hasTiles = total > 0
  30. noTiles = found && total == 0
  31. basePath = found ? '/genres/' + genreRow.urlSegment : '/genres'
  32. __title = found ? (pageNo > 1 ? name + ', page ' + pageNo + ' — ' + appTitle : name + ' — ' + appTitle) : appTitle
  33. // mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'catalog'
  34. // stage is there this page says so instead of showing half a map
  35. warming = !warmReady('catalog')
  36. warmNote = warming ? warmText() : ''
  37. View {
  38. listPage { id = "genre-page"
  39. if (warming) { p { id = "warming" class = "message banner" warmNote } }
  40. if (notFound) {
  41. h1 { "Not found" }
  42. p { "This genre doesn't exist." }
  43. }
  44. // tracker.worldapi.org#20: "Genre | Action", the type word in the genre colour, the name white
  45. if (found) { h1 { class = "typed" typeWord { class = "type-word type-genre" "Genre" } typeSep { "|" } typeName { name } } }
  46. if (noTiles) { p { class = "muted" "Nothing in this genre yet." } }
  47. if (hasTiles) { p { class = "muted list-count" countText } }
  48. // always there (no `if` around a composed component, like /movies): empty for an unknown genre, no pager on one page
  49. TileList { tiles = tiles page = pageNo pages = pageCount basePath = basePath }
  50. }
  51. }

Branches

Latest commits

  • fdf10b1alog: RV28d deployed on day38bmre
  • 320005e9log: RV28d merged, deploy runningmre
  • a8fef27dRV28d: reportmre
  • 2bae8373RV28d: re-vendor Hybriel set day38b (source 1e554d75, bin 5ff2a46d)mre
  • 16b3354aMerge branch 'main' into rv28cmre
  • 6f4f27d8log: RV28d started (day38b)mre
  • e6cf03ffmission RV28d: rv28c onto day38bmre
  • 3ccaee19status: live sweep freeze, waiting for Apollomre
  • 49f76ecblog: watch toggle slowness = session sweep freeze (tracker#50)mre
  • 3daf6eddlog: day37 live, still waiting for day39mre
  • 796ba672records: #277 slips to day39mre
  • a9eb9827records: mpackdb integrity clean, all 12 tablesmre
  • 6cf40dbdrecords: mpackdb integrity check, shows uncheckedmre
  • 1880f42arecords: day38 deploy may swap normallymre
  • 9d806e35records: mpackdb freeze until day38mre
  • a660239drecords: day37 lacks #277, wait for day38mre
  • b0abfdeaLOG: Anton hybriel#277 fix ready for day37mre
  • 7b5b2918Tracker: hybriel#277 fix comes in day37mre
  • 7ddbeec8Tracker: RV28c blocked on day35 regressionmre
  • 529096e8RV28c: reportmre