gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitd6b109bad6b109baMission SR1mred6b109ba/components/franchises.hl

3.1 KB

  1. // components/franchises.hl — `/franchises` (tracker.worldapi.org#19, mission 066): every franchise (→ its index), then the
  2. // timelines that belong to none (most of them TMDB's movie collections, collections.hl seed), each with its number of titles.
  3. // The creator sees an "Edit" link to the editor (/franchises/edit). Data: franchises.hl franchiseIndexPage (the franchises on page 1, the loose timelines 40 per page: /franchises/page/N).
  4. parent './main.hl'
  5. import { navigate } from 'hl:web'
  6. import { appTitle } from '../lib/app.hl'
  7. import { franchiseIndexPage, isEditorSession } from '../lib/franchises.hl'
  8. import Pagination from './pagination.hl'
  9. // static: an mpackdb-backed helper must be `static` (hybriel#115/#116), and LOCAL (mission 047)
  10. static indexOf = (&raw) => { return franchiseIndexPage(&raw) }
  11. static editorOf = (&session) => { return isEditorSession(&session) }
  12. session = null
  13. page = null
  14. canEdit = editorOf(&session)
  15. listing = indexOf(&page)
  16. franchiseRows = listing.franchises
  17. timelineRows = listing.timelines
  18. pageNo = listing.page
  19. hasFranchises = franchiseRows.length > 0
  20. noFranchises = franchiseRows.length == 0 && pageNo == 1
  21. hasTimelines = listing.total > 0
  22. pageCount = listing.pages
  23. hasPages = pageCount > 1
  24. // mobile audit MK: the timelines without a franchise are 40 per page (1,546 of them were one 54,000 px page that took 20 s)
  25. timelineCountText = (listing.total == 1 ? '1 timeline without a franchise' : listing.total + ' timelines without a franchise') + (hasPages ? ' · page ' + pageNo + ' of ' + pageCount : '')
  26. goPage = (to) => { navigate(to == 1 ? '/franchises' : '/franchises/page/' + to) }
  27. __title = pageNo > 1 ? 'Franchises, page ' + pageNo + ' — ' + appTitle : 'Franchises — ' + appTitle
  28. // Component styles use the shared theme variables.
  29. Style {
  30. franchisesPage {
  31. display = 'block'
  32. }
  33. franchiseList {
  34. display = 'block'
  35. marginBottom = '1.2rem'
  36. }
  37. aFranchiseRow {
  38. display = 'flex'
  39. alignItems = 'baseline'
  40. gap = '.8rem'
  41. padding = '.6rem 0'
  42. color = 'var(--color-text-strong)'
  43. }
  44. franchiseName {
  45. flex = '1'
  46. minWidth = '0'
  47. fontSize = '1.05rem'
  48. fontWeight = '600'
  49. overflowWrap = 'anywhere'
  50. }
  51. franchiseCount {
  52. flex = 'none'
  53. fontSize = '.85rem'
  54. color = 'var(--color-text-muted)'
  55. }
  56. }
  57. View {
  58. franchisesPage {
  59. franchisesHead {
  60. h1 { class = "typed" typeWord { class = "type-word type-franchise" "Franchises" } }
  61. if (canEdit) { a { id = "franchises-edit" class = "button" href = "/franchises/edit" "Edit" } }
  62. }
  63. if (noFranchises) { p { class = "muted" "No franchises yet." } }
  64. if (hasFranchises) {
  65. franchiseList { id = "franchise-list"
  66. for (f of franchiseRows) {
  67. a { Style.aFranchiseRow href = f.href
  68. franchiseName { f.name }
  69. franchiseCount { f.countText }
  70. }
  71. }
  72. }
  73. }
  74. if (hasTimelines) {
  75. h2 { class = "film-heading" "Timelines" }
  76. p { class = "muted list-count" timelineCountText }
  77. timelineList { id = "timeline-list"
  78. for (t of timelineRows) {
  79. a { class = "timeline-link" href = t.href
  80. timelineLinkName { t.name }
  81. timelineLinkCount { t.countText }
  82. }
  83. }
  84. }
  85. if (hasPages) {
  86. pagerBox { Pagination { pages = pageCount page = pageNo onPage = goPage } }
  87. }
  88. }
  89. }
  90. }

Branches

Latest commits

  • d6b109baMission SR1mre
  • 608b7558Log: FF1 merged via PR #1mre
  • 2939d94cMerge branch 'ff1-gate-failfast' into mainTracker
  • c934361a|||PR tests: gates fail fast when the app exits during startmre
  • d714ae42Log/status: AP56 closed out, FF1mre
  • a429d088Mission FF1mre
  • 03bbfba3Log: AP56c causemre
  • 24845fe3Log: AP56b result, AP56cmre
  • 6a6d71eaLog: gitoria membershipmre
  • 8b842dc8Log + CONDUCTOR: gitoria PR switch-onmre
  • 6bb7c20estatus: window 2026-11-09mre
  • 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
  • e84586a7Mission AP56bmre
  • 15917f03Record PR workflow rule (gitoria#50)mre
  • 942ac995status: paused workers statemre
  • 44b934e5log: respawn cleanupmre
  • 03a80097Log: Anton GC A/Bmre
  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre