gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc6d464e5c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmrec6d464e5/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

  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre
  • d049b8b8Log: HM50 live, #52 donemre
  • 6d05fa37Log: HM50 Part A mergedmre
  • 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
  • e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
  • 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
  • 2f391aa9Log: HM50 startedmre
  • 4b59c03dHM50 mission: doc pathmre
  • ed526d67HM50 missionmre
  • 2f986ca3Log: RT50 passmre