gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8d9ecdfe8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre8d9ecdfe/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

  • 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
  • 4a802ae7status: RV48 runningmre
  • 0a5412b6RV48 brief, day48 outmre
  • 56665efelog: CB69 mergedmre
  • 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
  • e55b379dKeep shared app title independent of the route import graphmre
  • 9a99659blog: hybriel#334, batch waits for day48mre
  • 85fa6c9blog: CB68 result, CB69 startedmre
  • 2f07c1b7log: DP68 boot gate failed, CB68mre
  • 9652782dlog: HM59 merged, DP68 startedmre
  • 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
  • f7bfe90bMove remaining page builders into their topicsmre
  • 7c3991f9log: day46 from Antonmre
  • ec54fc35Move show page logic into the shows topicmre
  • c1a8d074log: correct timesmre
  • 5827eba9log: HM57 merged, HM59 startedmre
  • d1a91be9Merge hm57-let: tracker#57 let only for reassigned namesmre
  • a404ed75Report HM57 audit, gates and integration notesmre
  • 1dcb87a7Use plain declarations for unchanged bindingsmre
  • b90395e3log: HM51 mergedmre