import { mediaUrl } from "../media.ts"; import { PUBLISH_FIELDS } from "./shared.ts"; /* ── Awards ──────────────────────────────────────────────────── */ export const awards = { key: "awards", label: "Awards", singular: "award", idLabel: "URL ID", slugFrom: "name", list: { columns: [ { key: "name", label: "Name", primary: true }, { key: "org_id", label: "Awarded by" }, { key: "description", label: "Description" }, { key: "is_published", label: "Live", widget: "bool" }, { key: "is_listed", label: "Listed", widget: "bool" }, ], filters: [ { key: "org_id", label: "Awarded by", optionsFrom: "organizations" }, { key: "is_published", label: "Published", options: [["1", "Live"], ["0", "Hidden"]] }, { key: "is_listed", label: "Listed", options: [["1", "Listed"], ["0", "Link only"]] }, ], }, groups: [ { legend: "Identity", note: "An award exists whether or not anyone has received it. " + "Who received it is edited on the person.", fields: [ { path: "org_id", label: "Awarded by", widget: "select", optionsFrom: "organizations", blankLabel: "- unattributed -", help: "The organization that gives this award", }, { path: "name", label: "Name", required: true }, { path: "description", label: "Description", widget: "textarea", full: true }, { path: "logo", label: "Logo", widget: "image", folder: "logos", resolve: mediaUrl, full: true }, ], }, { legend: "Publishing", note: "An unpublished award is a draft: off the site, and a 404 at its own page.", fields: PUBLISH_FIELDS, }, ], };