gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite5c9b659e5c9b659Pack retained search IDs into UTF-8 bytesmree5c9b659/components/tilelist.hl

1.7 KB

  1. // components/tilelist.hl — the poster grid + pagination of /movies and /shows (tracker.worldapi.org#13), composed by
  2. // components/movies.hl and components/allshows.hl: `TileList { tiles = … page = … pages = … basePath = '/movies' }`.
  3. // A tile: poster, title, year, a link to the show page. Page 1 is `basePath`, page n `basePath/page/n`. `tileClass` (tracker#37):
  4. // /people's tiles are "tile person-tile" (photo, the name in the person colour, no year).
  5. // The pagination is the shared copy (components/pagination.hl, layouts 76f99f6): it hands the clicked target page to `onPage`
  6. // (tracker#38 is solved there — no listener around it reading a button's text). `goPage` navigates client-side: the shell stays.
  7. import { navigate } from 'hl:web'
  8. import Pagination from './pagination.hl'
  9. tiles = []
  10. page = 1
  11. pages = 1
  12. basePath = '/'
  13. tileClass = 'tile'
  14. // one page only: no pagination at all (a lone "1" says nothing)
  15. hasPages = pages > 1
  16. goPage = (to) => { navigate(to == 1 ? basePath : basePath + '/page/' + to) }
  17. // Component styles use the shared theme variables.
  18. Style {
  19. tileGrid {
  20. display = 'grid'
  21. gridTemplateColumns = 'repeat(3, minmax(0, 1fr))'
  22. gap = '.8rem .6rem'
  23. marginBottom = '1rem'
  24. @media {
  25. minWidth = '40rem'
  26. gridTemplateColumns = 'repeat(6, minmax(0, 1fr))'
  27. gap = '1rem .8rem'
  28. }
  29. }
  30. 'a.person-tile' {
  31. tileTitle {
  32. color = 'var(--color-type5)'
  33. }
  34. tileYear {
  35. display = 'none'
  36. }
  37. }
  38. }
  39. View {
  40. tileList {
  41. tileGrid {
  42. for (t of tiles) {
  43. a { class = tileClass href = t.href
  44. img { class = "tile-poster" src = t.posterUrl alt = t.title loading = "lazy" }
  45. tileTitle { t.title }
  46. tileYear { t.year }
  47. }
  48. }
  49. }
  50. if (hasPages) {
  51. pagerBox { Pagination { pages = pages page = page onPage = goPage } }
  52. }
  53. }
  54. }

Branches

Latest commits

  • e5c9b659Pack retained search IDs into UTF-8 bytesmre
  • 62a5f6c7HM67 brief, HM66 mergedmre
  • b32b8440Merge hm66-catalogindex: packed catalog indexmre
  • 2db0f7adReport HM66 heap measurements and validationmre
  • 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
  • 71134e21HM66 briefmre
  • ed4cbab2status timemre
  • e982c26dlog: HM65 mergedmre
  • 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
  • 07a5c883HM65 report measured field projection and complete validationmre
  • 0eab858fRead only catalog date fields during the episode boot scanmre
  • d3179273log: HM65 hl:heap vendoringmre
  • cb78a1a0HM65 report missing heap diagnostic package with repromre
  • 89606a5cHM65 briefmre
  • 096ce0d4log: DP69 live on day48mre
  • b3d8a80bDP69 brief, RV48 mergedmre
  • ce6d7d32Merge rv48: Hybriel day48mre
  • 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
  • 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
  • 4a802ae7status: RV48 runningmre