gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit019d5ced019d5cedMerge branch 'records-1110' into mainTracker019d5ced/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

  • 019d5cedMerge branch 'records-1110' into mainTracker
  • f88ae8b9|||PR records: day56 toggle live, reviewTracker
  • b6b3bb4dMerge branch 'ap56e' into mainTracker
  • 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
  • 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
  • 4b54f6f9Merge branch 'records-audit' into mainTracker
  • cab4a3bc|||PR records: branch audit, PR-onlyTracker
  • 641e1c4cMerge branch 'records-dp71' into mainTracker
  • 85a6e9f5|||PR records: DP71 checked in ChromeTracker
  • f5be5f18records: gitoria PR-only planTracker
  • 46a37036records: DP71 liveTracker
  • 3bcb7039Status/log: DP71 in progressTracker
  • 5b3a5693Log: SR1b merged via PR 2, DP71 startedTracker
  • 783957c2Merge branch 'sr1-search' into mainTracker
  • 792b9652README: search results come from the routeTracker
  • fd8570b1|||PR search: one server exchange per keystrokeTracker
  • e8f5cbcaLog: SR1 result, SR1bTracker
  • 8ad275a4Log/status: tracker 68, SR1Tracker
  • f5a06a0fLog: gitoria push setup, SR1Tracker
  • d6b109baMission SR1mre