gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6da612fc6da612fclog: T36A tool defectmre6da612fc/components/franchises.hl

2.6 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 '../project.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. View {
  29. franchisesPage {
  30. franchisesHead {
  31. h1 { class = "typed" typeWord { class = "type-word type-franchise" "Franchises" } }
  32. if (canEdit) { a { id = "franchises-edit" class = "button" href = "/franchises/edit" "Edit" } }
  33. }
  34. if (noFranchises) { p { class = "muted" "No franchises yet." } }
  35. if (hasFranchises) {
  36. franchiseList { id = "franchise-list"
  37. for (f of franchiseRows) {
  38. a { class = "franchise-row" href = f.href
  39. franchiseName { f.name }
  40. franchiseCount { f.countText }
  41. }
  42. }
  43. }
  44. }
  45. if (hasTimelines) {
  46. h2 { class = "film-heading" "Timelines" }
  47. p { class = "muted list-count" timelineCountText }
  48. timelineList { id = "timeline-list"
  49. for (t of timelineRows) {
  50. a { class = "timeline-link" href = t.href
  51. timelineLinkName { t.name }
  52. timelineLinkCount { t.countText }
  53. }
  54. }
  55. }
  56. if (hasPages) {
  57. pagerBox { Pagination { pages = pageCount page = pageNo onPage = goPage } }
  58. }
  59. }
  60. }
  61. }

Branches

Latest commits

  • 6da612fclog: T36A tool defectmre
  • 08e55255log: HM56 done, T36A startedmre
  • 5fd2ac75status: #36 GOmre
  • 0d253b45mission: T36Amre
  • 2aa22d23log: #36 GOmre
  • 833aee2flog: #50 closed, HM56 startedmre
  • ac58c1e5mission: HM56mre
  • 58979c0clog: HM54 held for decision, DP65 startedmre
  • bb2ebc67log: #64 live, #53 mergedmre
  • 27cde42fMerge hm53-dom: tracker#53 inputs bound to membersmre
  • 2156cc7flog: HM54 reviewmre
  • 9fb82efclog: HM54 gap, fill continuesmre
  • b632eb8dlog: HM53 done, HM54 startedmre
  • ccb1a263tracker#53: bind editor drafts and use key event focus targetmre
  • 3356fcfclog: #52 blocked, HM53 startedmre
  • 833dcfc9Merge hm52-search: report only, tracker#52 blocked by framework gapmre
  • 73010cc0HM52: report replace-navigation search draft regressionmre
  • 1742e92bstatus: DP64 and HM52 runningmre
  • 29ad5b58log: #64 merged, DP64 and HM52 startedmre
  • fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre