gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit2047955b2047955bMerge branch 'u12-gateports' into mainTracker2047955b/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

  • 2047955bMerge branch 'u12-gateports' into mainTracker
  • 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
  • 0b86324aMerge branch 'records-dp73' into mainTracker
  • 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
  • 613ae0ecMerge branch 'bs3' into mainTracker
  • 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
  • 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
  • 310613f1Merge branch 'records-dp72' into mainTracker
  • 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
  • c41587d2Merge branch 'bs2' into mainTracker
  • 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
  • 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