Files
Gardomatic/internal/web/templates/partials/task_fields.tmpl
T
kleiax 904d14b64c
CI / test (push) Canceled after 0s
Initial commit
2026-09-12 22:22:17 +02:00

12 lines
2.7 KiB
Cheetah

{{define "task_fields"}}{{$form:=.Form}}{{$prefix:=.Prefix}}
<label>Name<input name='{{$prefix}}title' value='{{$form.Title}}' required></label>
<label>Beschreibung<textarea name='{{$prefix}}description' rows='4'>{{$form.Description}}</textarea></label>
<label>Tags</label><div class='tag-editor' data-tag-editor><div class='tag-bubbles' data-tag-bubbles></div><input name='{{$prefix}}keywords' value='{{$form.Keywords}}' placeholder='Tag eingeben …' autocomplete='off' data-tag-input><div class='tag-suggestions' data-tag-suggestions role='listbox' hidden>{{range .TagSuggestions}}<button type='button' data-tag-suggestion='{{.}}'>{{.}}</button>{{end}}</div></div>
{{if .ShowPlant}}<label>Pflanze (optional)<select name='{{$prefix}}plant_id' {{if .LockPlant}}disabled aria-disabled='true'{{end}}>{{if and .LockPlant .PendingPlantName}}<option value='0' selected>{{.PendingPlantName}} · wird beim Speichern angelegt</option>{{else}}<option value='0'>Keine</option>{{range .Plants}}<option value='{{.ID}}' {{if eqInt $form.PlantID .ID}}selected{{end}}>{{.Name}}</option>{{end}}{{end}}</select></label>{{end}}
<label>Ort (optional)<select name='{{$prefix}}location_id'><option value='0'>Keiner</option>{{range .Locations}}<option value='{{.ID}}' {{if eqInt $form.LocationID .ID}}selected{{end}}>{{.Name}}</option>{{end}}</select></label>
<div class='form-grid'><label>Fällig ab<input type='date' name='{{$prefix}}due_at_start' value='{{$form.DueAtStart}}'></label><label>Fällig bis<input type='date' name='{{$prefix}}due_at_end' value='{{$form.DueAtEnd}}'></label></div>
<fieldset><legend>Wiederholung</legend><div class='form-grid'><label>Alle<input type='number' min='1' name='{{$prefix}}recurrence_interval' value='{{$form.RecurrenceInterval}}'></label><label>Einheit<select name='{{$prefix}}recurrence'><option value=''>Keine</option><option value='daily' {{if eqString $form.Recurrence "daily"}}selected{{end}}>Tage</option><option value='weekly' {{if eqString $form.Recurrence "weekly"}}selected{{end}}>Wochen</option><option value='monthly' {{if eqString $form.Recurrence "monthly"}}selected{{end}}>Monate</option><option value='yearly' {{if eqString $form.Recurrence "yearly"}}selected{{end}}>Jahre</option></select></label></div></fieldset>
<label>Priorität<select name='{{$prefix}}priority'>{{range .TaskPriorities}}<option value='{{.Value}}' {{if eqInt $form.Priority .Value}}selected{{end}}>{{.Name}}</option>{{end}}</select></label>
<label>Pflanzenstatus nach Erledigung<select name='{{$prefix}}status_on_completion'><option value=''>Nicht ändern</option>{{range plantStatuses}}<option value='{{.Value}}' {{if eqString $form.PlantStatusOnCompletion .Value}}selected{{end}}>{{.Label}}</option>{{end}}</select></label>
{{end}}