Viewing:
{{define "body"}}
<div>
<form class="form" hx-post="/recipes">
<input
placeholder="title"
name="title"
/>
<textarea
placeholder="ingredients"
name="ingredients"
rows="8"
></textarea>
<textarea
placeholder="instructions"
name="instructions"
rows="8"
></textarea>
<input
placeholder="by"
name="by"
/>
<input
placeholder="source"
name="source"
/>
{{if .UserGroups }}
<div>Add recipes to these groups (none for a private recipe viewable only to yourself):</div>
{{ range $key, $val := .UserGroups}}
<label class="group-checkbox">
<input type="checkbox" name="groups" value={{$key}} {{if eq $val "public"}}checked{{end}}>
{{$val}}
</input>
</label>
{{end}}
{{end}}
<input type="submit"/>
</form>
</div>
{{end}}