import {escapeText, InfoRow} from "fwtoolkit" import {LICENSE_URLS} from "./index.js" interface LicenseSelectParams { url: string } interface LicenseInputParams { url: string title: string } export interface CopyrightParams { holder?: string year?: number freeToRead?: boolean } export const licenseSelectTemplate = ({url}: LicenseSelectParams) => `
` export const licenseInputTemplate = ({url, title}: LicenseInputParams) => `
` const copyrightRow = ( label: string, helpText: string, field: string, fieldClass = "" ): string => new InfoRow({ label, helpText, field, fieldClass }).html() export const copyrightTemplate = ({holder, year, freeToRead}: CopyrightParams) => ` ${copyrightRow( gettext("Copyright holder"), gettext("If the work is not in the public domain, specify who the copyright holder is."), `` )} ${copyrightRow( gettext("Copyright year"), gettext("If the work is not in the public domain, specify the year of the copyright."), `` )} ${copyrightRow( gettext("Available to read for free?"), gettext("Specify whether the work can be accessed without paying a fee."), `` )} ${copyrightRow( gettext("License(s)"), gettext('List any licenses the work is available under. If the license only applies from a given date, please specify the date in the ISO8601 format (such as "2012-10-15").'), ``, "licenses" )}
`