@@ -0,0 +1 @@
|
||||
{{define "care_instruction_list"}}{{$editable := canEditSpecies .Garden .CurrentUser .SpeciesGlobal .SpeciesID}}<div id='care-instruction-list' class='care-instruction-list'>{{range .CareInstructions}}{{$instruction := .}}<article class='care-instruction'>{{if $editable}}<form class='care-instruction-form' method='POST' action='{{webPath "species.care.edit" $.Garden.ID $.SpeciesID .ID}}'><input type='hidden' name='csrf_token' value='{{$.CSRFToken}}'><textarea name='text' required>{{.Text}}</textarea><div class='care-instruction-controls'><label class='sr-only' for='care-status-{{.ID}}'>Status</label><select id='care-status-{{.ID}}' name='status' aria-label='Status'>{{range careStatuses}}<option value='{{.Value}}' {{if eqString $instruction.Status .Value}}selected{{end}}>{{.Label}}</option>{{end}}</select><div class='care-instruction-actions'><button type='submit' class='care-action care-action-save' aria-label='Speichern' title='Speichern'><svg viewBox='0 0 24 24' aria-hidden='true'><path d='M5 12.5 10 17l9-10'/></svg></button><button type='submit' class='care-action care-action-remove' formaction='{{webPath "species.care.delete" $.Garden.ID $.SpeciesID .ID}}' aria-label='Entfernen' title='Entfernen'><svg viewBox='0 0 24 24' aria-hidden='true'><path d='M5 7h14M9 7V5h6v2m-8 0 1 13h8l1-13M10 11v5m4-5v5'/></svg></button></div></div></form>{{else}}<p>{{.Text}}</p><span class='status'>{{.Status}}</span>{{end}}</article>{{else}}<p class='muted'>Noch keine Pflegeanweisungen.</p>{{end}}</div>{{end}}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{define "location_fields"}}
|
||||
{{$form := .Form}}
|
||||
<input type='hidden' name='csrf_token' value='{{.CSRFToken}}'>
|
||||
<input type='hidden' name='return_to' value='{{$form.ReturnTo}}'>
|
||||
<label for='location-name'>Name</label>
|
||||
<input id='location-name' name='name' value='{{$form.Name}}' required>
|
||||
{{with index $form.Errors "name"}}<p class='field-error'>{{.}}</p>{{end}}
|
||||
{{template "image_editor" (dict "ImageData" $form.ImageData "ImageID" $form.ImageID "Images" .Images "GardenID" .Garden.ID)}}
|
||||
<label for='parent_id'>Übergeordneter Ort</label>
|
||||
<select id='parent_id' name='parent_id'>
|
||||
<option value='0'>Keiner</option>
|
||||
{{range .Locations}}<option value='{{.ID}}' {{if eqInt $form.ParentID .ID}}selected{{end}}>{{.Name}}</option>{{end}}
|
||||
</select>
|
||||
{{with index $form.Errors "parent_id"}}<p class='field-error'>{{.}}</p>{{end}}
|
||||
<label for='kind'>Art des Orts</label>
|
||||
<input id='kind' name='kind' value='{{$form.Kind}}' placeholder='z. B. Beet, Topf oder Gewächshaus'>
|
||||
<label for='area_sqm'>Fläche in m²</label>
|
||||
<input id='area_sqm' name='area_sqm' inputmode='decimal' value='{{$form.AreaSQM}}'>
|
||||
{{with index $form.Errors "area_sqm"}}<p class='field-error'>{{.}}</p>{{end}}
|
||||
<label for='sun_exposure'>Licht</label>
|
||||
<select id='sun_exposure' name='sun_exposure'><option value=''>Nicht angegeben</option><option value='sunny' {{if eqString $form.SunExposure "sunny"}}selected{{end}}>Sonnig</option><option value='partial_shade' {{if eqString $form.SunExposure "partial_shade"}}selected{{end}}>Halbschattig</option><option value='shade' {{if eqString $form.SunExposure "shade"}}selected{{end}}>Schattig</option></select>
|
||||
<label for='soil_condition'>Bodenbeschaffenheit</label><select id='soil_condition' name='soil_condition'><option value=''>Nicht angegeben</option><option value='dry' {{if eqString $form.SoilCondition "dry"}}selected{{end}}>Trocken</option><option value='moist' {{if eqString $form.SoilCondition "moist"}}selected{{end}}>Feucht</option><option value='boggy' {{if eqString $form.SoilCondition "boggy"}}selected{{end}}>Sumpfig</option></select>
|
||||
<label for='soil_reaction'>Bodenreaktion</label><select id='soil_reaction' name='soil_reaction'><option value=''>Nicht angegeben</option><option value='alkaline' {{if eqString $form.SoilReaction "alkaline"}}selected{{end}}>Basisch</option><option value='acidic' {{if eqString $form.SoilReaction "acidic"}}selected{{end}}>Sauer</option><option value='neutral' {{if eqString $form.SoilReaction "neutral"}}selected{{end}}>Neutral</option></select>
|
||||
<label for='description'>Beschreibung</label>
|
||||
<textarea id='description' name='description' rows='4'>{{$form.Description}}</textarea>
|
||||
{{end}}
|
||||
|
||||
{{define "location_dialog"}}
|
||||
<dialog class='location-dialog'>
|
||||
<form action='{{webPath "location.new" .Garden.ID}}' method='POST'
|
||||
hx-post='{{webPath "location.new" .Garden.ID}}' hx-target='#location_id' hx-swap='beforeend'>
|
||||
<h3>Ort direkt anlegen</h3>
|
||||
{{template "location_fields" .}}
|
||||
<div class='actions'><button type='submit'>Anlegen und auswählen</button><button type='button' class='secondary' data-close-dialog>Abbrechen</button></div>
|
||||
</form>
|
||||
</dialog>
|
||||
{{end}}
|
||||
|
||||
{{define "location_option"}}{{range .Locations}}<option value='{{.ID}}' selected>{{.Name}}</option>{{end}}{{end}}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{define "plant_template_tasks"}}<div id='plant-template-tasks' class='plant-task-list'>{{if .SpeciesID}}{{range index .TaskTemplates .SpeciesID}}<div class='plant-template-task-row'><button type='button' class='plant-task-name' hx-get='{{pathWithQuery (webPath "plant.template-task" $.Garden.ID .ID) "species_id" $.SpeciesID}}' hx-target='#plant-task-dialog-host' hx-swap='innerHTML'>{{.Title}}</button><input type='hidden' name='plant_template_active_{{.ID}}' value='{{if index $.TemplateOptOuts .ID}}false{{else}}true{{end}}' data-toggle-value><label class='switch' aria-label='{{.Title}} aktivieren oder deaktivieren'><input type='checkbox' data-toggle-control {{if not (index $.TemplateOptOuts .ID)}}checked{{end}}><span></span></label></div>{{else}}<p class='muted'>Für diese Art sind keine Aufgabenvorlagen hinterlegt.</p>{{end}}{{else}}<p class='muted'>Nach Auswahl einer Art erscheinen hier deren Aufgabenvorlagen.</p>{{end}}</div>{{end}}
|
||||
|
||||
{{define "plant_task_row_fragment"}}{{range .PlantTasks}}
|
||||
<div id='{{.RowKey}}' class='plant-task-row' data-plant-task-row>
|
||||
<input type='hidden' name='plant_task_row_key' value='{{.RowKey}}'><input type='hidden' name='plant_task_id' value='{{.ID}}'><input type='hidden' name='plant_task_plant_id' value='{{.PlantID}}'><input type='hidden' name='pending_plant_name' value='{{.PendingPlantName}}'>
|
||||
<input type='hidden' name='plant_task_title' value='{{.Title}}'><input type='hidden' name='plant_task_description' value='{{.Description}}'><input type='hidden' name='plant_task_due_at_start' value='{{.DueAtStart}}'><input type='hidden' name='plant_task_due_at_end' value='{{.DueAtEnd}}'><input type='hidden' name='plant_task_priority' value='{{.Priority}}'><input type='hidden' name='plant_task_location_id' value='{{.LocationID}}'><input type='hidden' name='plant_task_recurrence' value='{{.Recurrence}}'><input type='hidden' name='plant_task_recurrence_interval' value='{{.RecurrenceInterval}}'><input type='hidden' name='plant_task_keywords' value='{{.Keywords}}'><input type='hidden' name='plant_task_status_on_completion' value='{{.PlantStatusOnCompletion}}'><input type='hidden' name='plant_task_active' value='{{if .Active}}true{{else}}false{{end}}' data-toggle-value><input type='hidden' name='plant_task_delete' value='false' data-plant-task-delete>
|
||||
<button type='button' class='plant-task-name' hx-get='{{webPath "plant.task-row" $.Garden.ID}}' hx-include='closest [data-plant-task-row]' hx-target='#plant-task-dialog-host' hx-swap='innerHTML'>{{.Title}}</button><label class='switch' aria-label='{{.Title}} aktivieren oder deaktivieren'><input type='checkbox' data-toggle-control {{if .Active}}checked{{end}}><span></span></label><button type='button' class='template-remove' data-remove-plant-task aria-label='{{.Title}} löschen' title='Aufgabe löschen'>×</button>
|
||||
</div>{{end}}{{end}}
|
||||
|
||||
{{define "plant_task_dialog"}}{{$form := .Form}}
|
||||
<dialog class='plant-task-dialog'><form method='POST' action='{{webPath "plant.task-row" .Garden.ID}}' hx-post='{{webPath "plant.task-row" .Garden.ID}}' hx-target='{{if .TaskDialogNew}}#plant-manual-tasks{{else}}#{{$form.RowKey}}{{end}}' hx-swap='{{if .TaskDialogNew}}beforeend{{else}}outerHTML{{end}}'>
|
||||
<h3>{{if .TaskDialogNew}}Aufgabe hinzufügen{{else}}Aufgabe bearbeiten{{end}}</h3><input type='hidden' name='csrf_token' value='{{.CSRFToken}}'><input type='hidden' name='new' value='{{if .TaskDialogNew}}true{{else}}false{{end}}'><input type='hidden' name='plant_task_row_key' value='{{$form.RowKey}}'><input type='hidden' name='plant_task_id' value='{{$form.ID}}'><input type='hidden' name='plant_task_plant_id' value='{{$form.PlantID}}'><input type='hidden' name='pending_plant_name' value='{{.PendingPlantName}}'><input type='hidden' name='plant_task_active' value='{{if $form.Active}}true{{else}}false{{end}}'><input type='hidden' name='plant_task_delete' value='false'>
|
||||
{{template "task_fields" (dict "Form" $form "Prefix" "plant_task_" "ShowPlant" true "LockPlant" true "PendingPlantName" .PendingPlantName "Plants" .Plants "Locations" .Locations "TaskPriorities" .TaskPriorities "TagSuggestions" .TagSuggestions)}}
|
||||
<div class='actions'><button type='submit'>Übernehmen</button><button type='button' class='secondary' data-close-dialog>Abbrechen</button></div>
|
||||
</form></dialog>{{end}}
|
||||
|
||||
{{define "plant_template_task_dialog"}}{{range index .TaskTemplates .SpeciesID}}<dialog class='plant-task-dialog'><p class='eyebrow'>Aufgabenvorlage{{if and .Origin (not (eqString .Origin "manual"))}} · automatisch{{end}}</p><h3>{{.Title}}</h3>{{with .Description}}<p>{{.}}</p>{{else}}<p class='muted'>Keine Beschreibung hinterlegt.</p>{{end}}<dl class='task-detail-list'><dt>Typ</dt><dd>{{if eqString .TriggerType "month_of_year"}}Datum{{else if eqString .TriggerType "relative_to_planting"}}Nach Pflanzdatum{{else if eqString .TriggerType "relative_to_species_planting"}}Nach Pflanzsaison{{else if eqString .TriggerType "relative_to_sowing"}}Nach Aussaat{{else if eqString .TriggerType "relative_to_harvest"}}Nach Ernte{{else}}Nach letzter Erledigung{{end}}</dd>{{if eqString .TriggerType "month_of_year"}}<dt>Ab</dt><dd>{{with .DayFrom}}{{.}}.{{end}}{{with .MonthFrom}}{{.}}{{end}}</dd>{{else}}<dt>Nach</dt><dd>{{durationDescription .TriggerOffset .TriggerOffsetUnit}}</dd>{{end}}<dt>Bis in</dt><dd>{{durationDescription .Duration .DurationUnit}}</dd><dt>Priorität</dt><dd>{{configuredPriorityName $.TaskPriorities .Priority}}</dd><dt>Wiederholung</dt><dd>{{with recurrenceDescription .Recurrence .RecurrenceInterval}}{{.}}{{else}}Keine{{end}}</dd></dl><div class='actions'><button type='button' class='secondary' data-close-dialog>Schließen</button></div></dialog>{{end}}{{end}}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{define "task_template_fields"}}
|
||||
{{$form := .Form}}
|
||||
<input type='hidden' name='csrf_token' value='{{.CSRFToken}}'>
|
||||
<label for='template-title'>Name</label><input id='template-title' name='title' value='{{$form.Title}}'>{{with index $form.Errors "title"}}<p class='field-error'>{{.}}</p>{{end}}
|
||||
<label for='template-description'>Beschreibung</label><textarea id='template-description' name='description'>{{$form.Description}}</textarea>
|
||||
{{if and $form.Origin (not (eqString $form.Origin "manual"))}}<p class='muted'>Automatisch aus den Saisonangaben der Art abgeleitet.</p><input type='hidden' name='trigger_type' value='{{$form.TriggerType}}'>{{end}}
|
||||
<label for='template-trigger-type'>Typ</label><select id='template-trigger-type' name='trigger_type' data-template-trigger {{if and $form.Origin (not (eqString $form.Origin "manual"))}}disabled{{end}}><option value='month_of_year' {{if eqString $form.TriggerType "month_of_year"}}selected{{end}}>Datum</option><option value='relative_to_planting' {{if eqString $form.TriggerType "relative_to_planting"}}selected{{end}}>Nach Pflanzdatum</option><option value='relative_to_species_planting' {{if eqString $form.TriggerType "relative_to_species_planting"}}selected{{end}}>Nach Pflanzsaison</option><option value='relative_to_harvest' {{if eqString $form.TriggerType "relative_to_harvest"}}selected{{end}}>Nach Ernte</option><option value='relative_to_sowing' {{if eqString $form.TriggerType "relative_to_sowing"}}selected{{end}}>Nach Aussaat</option></select>
|
||||
<fieldset data-trigger-fields='month_of_year' {{if not (eqString $form.TriggerType "month_of_year")}}hidden disabled{{end}}><legend>Ab</legend><div class='form-grid'><label>Tag<input type='number' min='1' max='31' name='day_from' value='{{$form.DayFrom}}'></label><label>Monat<select name='month_from'><option value='0'>Bitte wählen</option>{{range months}}<option value='{{.Value}}' {{if eqInt $form.MonthFrom .Value}}selected{{end}}>{{.Label}}</option>{{end}}</select></label></div>{{with index $form.Errors "date"}}<p class='field-error'>{{.}}</p>{{end}}</fieldset>
|
||||
<fieldset data-trigger-fields='relative' {{if eqString $form.TriggerType "month_of_year"}}hidden disabled{{end}}><legend>Nach</legend><div class='form-grid'><label>Dauer<input type='number' min='0' name='trigger_offset' value='{{$form.TriggerOffset}}'></label><label>Einheit<select name='trigger_offset_unit'><option value='day' {{if eqString $form.TriggerOffsetUnit "day"}}selected{{end}}>Tage</option><option value='week' {{if eqString $form.TriggerOffsetUnit "week"}}selected{{end}}>Wochen</option><option value='month' {{if eqString $form.TriggerOffsetUnit "month"}}selected{{end}}>Monate</option></select></label></div></fieldset>
|
||||
<fieldset><legend>Bis in</legend><div class='form-grid'><label>Dauer<input type='number' min='0' name='duration' value='{{$form.Duration}}'></label><label>Einheit<select name='duration_unit'><option value='day' {{if eqString $form.DurationUnit "day"}}selected{{end}}>Tage</option><option value='week' {{if eqString $form.DurationUnit "week"}}selected{{end}}>Wochen</option><option value='month' {{if eqString $form.DurationUnit "month"}}selected{{end}}>Monate</option></select></label></div>{{with index $form.Errors "duration"}}<p class='field-error'>{{.}}</p>{{end}}</fieldset>
|
||||
<fieldset><legend>Wiederholung</legend><div class='form-grid'><label>Alle<input type='number' min='1' name='recurrence_interval' value='{{$form.RecurrenceInterval}}'></label><label>Einheit<select name='recurrence'><option value='' {{if eqString $form.Recurrence ""}}selected{{end}}>Keine Wiederholung</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><p class='muted'>Die nächste Aufgabe wird erst beim Erledigen angelegt.</p>{{with index $form.Errors "recurrence_interval"}}<p class='field-error'>{{.}}</p>{{end}}</fieldset>
|
||||
<label for='template-priority'>Priorität</label><select id='template-priority' name='priority'>{{range .TaskPriorities}}<option value='{{.Value}}' {{if eqInt $form.Priority .Value}}selected{{end}}>{{.Name}}</option>{{end}}</select>
|
||||
<label class='checkbox'><input type='checkbox' name='active' value='true' {{if $form.Active}}checked{{end}}> Aktiv</label>
|
||||
{{end}}
|
||||
|
||||
{{define "task_template_dialog"}}
|
||||
{{$species := index .Species 0}}
|
||||
<dialog class='task-template-dialog'>
|
||||
{{$action := pathWithQuery (webPath "task-template.new" .Garden.ID) "species_id" .SpeciesID}}{{if .TemplateID}}{{$action = pathWithQuery (webPath "task-template.edit" .Garden.ID .TemplateID) "species_id" .SpeciesID}}{{end}}<form action='{{$action}}' method='POST' hx-post='{{$action}}' hx-target='#task-template-dialog-host' hx-swap='innerHTML'>
|
||||
<p class='eyebrow'>{{$species.CommonName}}</p><h3>{{if .TemplateID}}Aufgabe bearbeiten{{else}}Aufgabe anlegen{{end}}</h3>
|
||||
{{template "task_template_fields" .}}
|
||||
<div class='actions'><button type='submit'>Speichern</button><button type='button' class='secondary' data-close-dialog>Abbrechen</button></div>
|
||||
</form>
|
||||
</dialog>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user