${escape(catalogueNumber(item.id, item.created_at))} · Vitrine ${vitrineIndex + 1}
${escape(VITRINES[vitrineIndex]!)}
${escape(item.description)}
- Accessioned
- ${escape(item.created_at)}
- Condition
- ${escape(conditionOf(item.id))}
/** The two pages: the entrance (catalogue and intake form) and a case. */ import { escape } from "./html.ts"; import { catalogueNumber, conditionOf, vitrineOf, VITRINES } from "./museum.ts"; import type { Item, ItemWithCount, Note } from "./db.ts"; function layout(env: string, commit: string, body: string): string { return `
lost-property ${escape(env)} ${commit ? "@ " + escape(commit) : ""}
`; } export function renderHome(items: ItemWithCount[], env: string, commit: string): string { const rows = items .map((item) => { const vitrine = vitrineOf(item.description); const short = item.description.length > 80 ? item.description.slice(0, 80) + "…" : item.description; return `A museum of lost things. Describe what you lost; the museum accessions it — a catalogue number, a vitrine, a plaque written in the flat voice of a museum label. Other visitors can leave a note on any case: that they saw one like it, or that they have the other half.
${escape(n.body)}
${escape(n.created_at)}${escape(catalogueNumber(item.id, item.created_at))} · Vitrine ${vitrineIndex + 1}
${escape(item.description)}
No notes yet.
`} `, ); }