tracker
All repositories: gitoria
2.6 KB
// components/franchises.hl — `/franchises` (tracker.worldapi.org#19, mission 066): every franchise (→ its index), then the// timelines that belong to none (most of them TMDB's movie collections, collections.hl seed), each with its number of titles.// 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).parent './main.hl'import { navigate } from 'hl:web'import { appTitle } from '../project.hl'import { franchiseIndexPage, isEditorSession } from '../lib/franchises.hl'import Pagination from './pagination.hl'// static: an mpackdb-backed helper must be `static` (hybriel#115/#116), and LOCAL (mission 047)static indexOf = (&raw) => { return franchiseIndexPage(&raw) }static editorOf = (&session) => { return isEditorSession(&session) }session = nullpage = nullcanEdit = editorOf(&session)listing = indexOf(&page)franchiseRows = listing.franchisestimelineRows = listing.timelinespageNo = listing.pagehasFranchises = franchiseRows.length > 0noFranchises = franchiseRows.length == 0 && pageNo == 1hasTimelines = listing.total > 0pageCount = listing.pageshasPages = pageCount > 1// 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)timelineCountText = (listing.total == 1 ? '1 timeline without a franchise' : listing.total + ' timelines without a franchise') + (hasPages ? ' · page ' + pageNo + ' of ' + pageCount : '')goPage = (to) => { navigate(to == 1 ? '/franchises' : '/franchises/page/' + to) }__title = pageNo > 1 ? 'Franchises, page ' + pageNo + ' — ' + appTitle : 'Franchises — ' + appTitleView {franchisesPage {franchisesHead {h1 { class = "typed" typeWord { class = "type-word type-franchise" "Franchises" } }if (canEdit) { a { id = "franchises-edit" class = "button" href = "/franchises/edit" "Edit" } }}if (noFranchises) { p { class = "muted" "No franchises yet." } }if (hasFranchises) {franchiseList { id = "franchise-list"for (f of franchiseRows) {a { class = "franchise-row" href = f.hreffranchiseName { f.name }franchiseCount { f.countText }}}}}if (hasTimelines) {h2 { class = "film-heading" "Timelines" }p { class = "muted list-count" timelineCountText }timelineList { id = "timeline-list"for (t of timelineRows) {a { class = "timeline-link" href = t.hreftimelineLinkName { t.name }timelineLinkCount { t.countText }}}}if (hasPages) {pagerBox { Pagination { pages = pageCount page = pageNo onPage = goPage } }}}}}
Branches
Latest commits
- 7793cf94HM62b report: person indexes with fixed mpackdbmre
- 09d66ed5status: #60 livemre
- 4171672flog: #60 livemre
- f52862a2log: HM62b startedmre
- 88fde2c4mission HM62bmre
- a722e526log: #62 blocked by hybriel#317mre
- 074a7418log: #62 assigned to Tracker; pending rulemre
- 06f6ae8fHM62 report: mpackdb index gapmre
- 86fe5430log: HM62 startedmre
- 755307bbmission HM62mre
- 4b2f2995HM61 report: tracker#61 packed people ordermre
- 48faa84flog: #60 deploy startedmre
- 90734c6cMerge branch 'hm60-shortids'mre
- e0db0d1bHM60 report: tracker#60 packed short-ID ownersmre
- 3c79b576Pack short-ID ownership into byte buffersmre
- e822524bstatus wordingmre
- 1c7f0480log: HM60/HM61 startedmre
- 2841d215missions HM60 HM61mre
- 289c6ce4HM1 report: heap object breakdownmre
- 2e7d6257log: HM1 startedmre