{{define "title"}}{{.Title}}{{end}} {{define "content"}}

{{.Data.Heading}}

{{with .Data.Error}} {{template "callout" dict "Tone" "negative" "Body" . "Alert" true}} {{end}}
{{template "field" dict "ID" "title" "Name" "title" "Label" "What is it?" "Value" .Data.Title "Required" true "Autofocus" true "Placeholder" "Quick chat" "Error" (if_eq .Data.ErrorField "title" .Data.Error)}} {{template "field-textarea" dict "Name" "description" "Label" "A line or two for the person booking" "Value" .Data.Description "Rows" 2 "Error" (if_eq .Data.ErrorField "description" .Data.Error)}} {{/* The sentence. ONE parser reads it, on the server; booking.js only asks that parser while you type. Scriptless, the pane below is filled in when the form comes back. */}}
Days and times, in your own zone. Commas between clauses; a clause with no day keeps the day before it. {{with (if_eq .Data.ErrorField "availability" .Data.Error)}}{{.}}{{end}}
{{template "bookingpane" .Data.Pane}}
{{template "field-select" dict "ID" "duration_min" "Name" "duration_min" "Label" "How long is a slot?" "Options" (list (dict "Value" "15" "Label" "15 minutes" "Selected" (eq .Data.DurationMin "15")) (dict "Value" "20" "Label" "20 minutes" "Selected" (eq .Data.DurationMin "20")) (dict "Value" "30" "Label" "30 minutes" "Selected" (eq .Data.DurationMin "30")) (dict "Value" "45" "Label" "45 minutes" "Selected" (eq .Data.DurationMin "45")) (dict "Value" "60" "Label" "An hour" "Selected" (eq .Data.DurationMin "60")) (dict "Value" "90" "Label" "An hour and a half" "Selected" (eq .Data.DurationMin "90")) (dict "Value" "120" "Label" "Two hours" "Selected" (eq .Data.DurationMin "120"))) "Error" (if_eq .Data.ErrorField "duration_min" .Data.Error)}} {{template "field" dict "ID" "buffer_min" "Name" "buffer_min" "Label" "Minutes between slots" "Value" .Data.BufferMin "Type" "number" "Min" "0" "Max" "120" "Short" true "Error" (if_eq .Data.ErrorField "buffer_min" .Data.Error)}} {{template "field" dict "ID" "notice_min" "Name" "notice_min" "Label" "Minimum notice, in minutes" "Value" .Data.NoticeMin "Type" "number" "Min" "0" "Max" "10080" "Short" true "Help" "Nothing is ever offered less than ten minutes ahead." "Error" (if_eq .Data.ErrorField "notice_min" .Data.Error)}} {{template "field" dict "ID" "horizon_days" "Name" "horizon_days" "Label" "How far ahead, in days" "Value" .Data.HorizonDays "Type" "number" "Min" "1" "Max" "90" "Short" true "Error" (if_eq .Data.ErrorField "horizon_days" .Data.Error)}} {{template "form-foot" dict "Submit" .Data.Submit "CancelHref" "/settings/booking" "CancelLabel" "Cancel"}}
{{end}}