{{define "title"}}{{if .TaskID}}Aufgabe bearbeiten{{else}}Aufgabe anlegen{{end}}{{end}} {{define "main"}} {{$canSave := canGarden .Garden "tasks:create"}}{{if .TaskID}}{{$canSave = canGardenResource .Garden .CurrentUser .TaskCreatedBy "tasks:update:own" "tasks:update:other"}}{{end}}

{{if .TaskID}}Aufgabe bearbeiten{{else}}Neue Aufgabe{{end}}

{{template "task_fields" (dict "Form" .Form "Prefix" "" "ShowPlant" true "Plants" .Plants "Locations" .Locations "TaskPriorities" .TaskPriorities "TagSuggestions" .TagSuggestions)}}
{{if $canSave}}{{end}}{{if $canSave}}Abbrechen{{else}}Zurück{{end}}
{{if and .TaskID (canGardenResource .Garden .CurrentUser .TaskCreatedBy "tasks:delete:own" "tasks:delete:other")}}
{{end}}
{{end}}