Request form: short field titles with a help line, and why to send a file
Detail fields can carry a help line under the title (RequestField help). The blog post's card field is now Short description, saying where it shows; other long titles became short ones with the detail in the help. The Files note explains that a blog post sent as a .docx can be imported straight onto the site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
79c4b243f5
commit
af7e99895a
2 changed files with 24 additions and 12 deletions
|
|
@ -32,7 +32,10 @@ export type RequestAction = "new" | "update";
|
|||
|
||||
export type RequestField = {
|
||||
key: string;
|
||||
/** A short title for the field. */
|
||||
label: string;
|
||||
/** A line under the title: what it's for, or where it shows. */
|
||||
help?: string;
|
||||
input?: "text" | "date" | "url" | "email" | "textarea";
|
||||
placeholder?: string;
|
||||
to?: { path: string } | { link: "website" | "email" | "action"; label: string } | { block: "card" };
|
||||
|
|
@ -56,7 +59,7 @@ const STATE: RequestField = { key: "state", label: "State or province", placehol
|
|||
const COUNTRY: RequestField = { key: "country", label: "Country", placeholder: "eg. US", to: { path: "country" } };
|
||||
const WEBSITE: RequestField = { key: "website", label: "Website", input: "url", placeholder: "https://", to: { link: "website", label: "Website" } };
|
||||
const EMAIL: RequestField = { key: "email", label: "Contact email", input: "email", to: { link: "email", label: "Email" } };
|
||||
const DESCRIPTION: RequestField = { key: "description", label: "Short description", input: "textarea", to: { block: "card" } };
|
||||
const DESCRIPTION: RequestField = { key: "description", label: "Short description", help: "A line or two shown on its card in lists and at the top of its page.", input: "textarea", to: { block: "card" } };
|
||||
|
||||
export const REQUEST_TYPES: RequestType[] = [
|
||||
{
|
||||
|
|
@ -68,8 +71,8 @@ export const REQUEST_TYPES: RequestType[] = [
|
|||
entity: "blog_posts",
|
||||
heading: "title",
|
||||
fields: [
|
||||
{ key: "author", label: "Author's name, as it should appear", to: { path: "guest_author" } },
|
||||
{ key: "excerpt", label: "A line or two for the post's card", input: "textarea", to: { path: "excerpt" } },
|
||||
{ key: "author", label: "Author", help: "Their name as it should appear on the post.", to: { path: "guest_author" } },
|
||||
{ key: "excerpt", label: "Short description", help: "A line or two shown on the post's preview card, eg. in the Community blog.", input: "textarea", to: { path: "excerpt" } },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -100,11 +103,11 @@ export const REQUEST_TYPES: RequestType[] = [
|
|||
heading: "name",
|
||||
preset: { kind: "group" },
|
||||
fields: [
|
||||
{ key: "region", label: "Region it's in", placeholder: "eg. Great Lakes" },
|
||||
{ key: "region", label: "Region", help: "The Unity region it's part of, if you know it.", placeholder: "eg. Great Lakes" },
|
||||
CITY,
|
||||
STATE,
|
||||
COUNTRY,
|
||||
{ key: "meets", label: "When it meets", placeholder: "eg. 2nd Sundays, 6:00pm", to: { path: "group.meets" } },
|
||||
{ key: "meets", label: "Meeting time", placeholder: "eg. 2nd Sundays, 6:00pm", to: { path: "group.meets" } },
|
||||
WEBSITE,
|
||||
EMAIL,
|
||||
DESCRIPTION,
|
||||
|
|
@ -141,8 +144,8 @@ export const REQUEST_TYPES: RequestType[] = [
|
|||
entity: "teams",
|
||||
heading: "name",
|
||||
fields: [
|
||||
{ key: "organization", label: "Which organization it belongs to", placeholder: "eg. NGU national" },
|
||||
{ key: "tagline", label: "What it does, in a line", to: { path: "tagline" } },
|
||||
{ key: "organization", label: "Organization", help: "The organization the team belongs to.", placeholder: "eg. NGU national" },
|
||||
{ key: "tagline", label: "Tagline", help: "What the team does, in a line.", to: { path: "tagline" } },
|
||||
EMAIL,
|
||||
DESCRIPTION,
|
||||
],
|
||||
|
|
@ -156,9 +159,9 @@ export const REQUEST_TYPES: RequestType[] = [
|
|||
entity: "awards",
|
||||
heading: "name",
|
||||
fields: [
|
||||
{ key: "organization", label: "Who gives it", placeholder: "eg. NGU national" },
|
||||
{ key: "organization", label: "Given by", help: "The organization that gives the award.", placeholder: "eg. NGU national" },
|
||||
{ key: "description", label: "What it's for", input: "textarea", to: { path: "description" } },
|
||||
{ key: "recipients", label: "Who received it, and when", input: "textarea" },
|
||||
{ key: "recipients", label: "Recipients", help: "Who received it, and in which year.", input: "textarea" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -171,7 +174,7 @@ export const REQUEST_TYPES: RequestType[] = [
|
|||
heading: "display_name",
|
||||
fields: [
|
||||
{ key: "pronouns", label: "Pronouns", placeholder: "eg. she/her", to: { path: "pronouns" } },
|
||||
{ key: "tagline", label: "Role or title", to: { path: "tagline" } },
|
||||
{ key: "tagline", label: "Role or title", help: "Shown under their name, eg. Retreat Team Lead.", to: { path: "tagline" } },
|
||||
CITY,
|
||||
STATE,
|
||||
{ key: "email", label: "Public email", input: "email", to: { path: "public_email" } },
|
||||
|
|
|
|||
|
|
@ -235,8 +235,10 @@ export default function RequestForm() {
|
|||
<div className="mt-4 grid gap-4 sm:grid-cols-2">
|
||||
{type.fields.map((f) => {
|
||||
const id = `request-detail-${f.key}`;
|
||||
const helpId = f.help ? `${id}-help` : undefined;
|
||||
const common = {
|
||||
id,
|
||||
"aria-describedby": helpId,
|
||||
value: details[f.key] ?? "",
|
||||
placeholder: f.placeholder,
|
||||
maxLength: 2000,
|
||||
|
|
@ -248,6 +250,11 @@ export default function RequestForm() {
|
|||
<label htmlFor={id} className="block text-sm font-medium text-body">
|
||||
{f.label}
|
||||
</label>
|
||||
{f.help && (
|
||||
<p id={helpId} className="mt-0.5 text-xs" style={{ color: MUTED }}>
|
||||
{f.help}
|
||||
</p>
|
||||
)}
|
||||
{f.input === "textarea" ? (
|
||||
<textarea {...common} rows={3} onChange={(e) => set(e.target.value)} className={`mt-2 resize-y ${fieldClass}`} />
|
||||
) : (
|
||||
|
|
@ -298,8 +305,10 @@ export default function RequestForm() {
|
|||
<OptionalTag />
|
||||
</div>
|
||||
<p className="mt-1 max-w-prose text-sm" style={{ color: MUTED }}>
|
||||
A Word document (.docx) with the details or the post itself, photos (JPEG or PNG) or a PDF. Up to{" "}
|
||||
{MAX_FILES}, {MAX_FILE_MB} MB each.
|
||||
Why a file: a blog post sent as a Word document (.docx) can be imported straight onto the site, its
|
||||
headings, lists, tables and links as written, so nothing needs retyping. For anything else, a document
|
||||
with the details, photos (JPEG or PNG) or a PDF saves us asking. Up to {MAX_FILES} files,{" "}
|
||||
{MAX_FILE_MB} MB each.
|
||||
</p>
|
||||
<input
|
||||
id="request-files"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue