200 lines
7.6 KiB
HTML
200 lines
7.6 KiB
HTML
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>FarmCal - Anbau planen</title>
|
|
<link rel="icon" type="image/svg+xml" href="/static/farmcal-icon.svg">
|
|
<link rel="stylesheet" href="/static/styles.css">
|
|
</head>
|
|
<body>
|
|
<header class="top"><h1><img src="/static/farmcal-icon.svg" alt="" class="brand-icon">FarmCal</h1><p>Anbau planen</p></header>
|
|
<nav class="tabs">
|
|
<a href="/" class="{{if eq .ActivePath "/"}}active{{end}}">Dashboard</a>
|
|
<a href="/planning" class="{{if eq .ActivePath "/planning"}}active{{end}}">Anbau planen</a>
|
|
<a href="/crops" class="{{if eq .ActivePath "/crops"}}active{{end}}">Feldfrüchte</a>
|
|
<a href="/fields" class="{{if eq .ActivePath "/fields"}}active{{end}}">Felder & Gruppen</a>
|
|
<a href="/general" class="{{if eq .ActivePath "/general"}}active{{end}}">Allgemein</a>
|
|
</nav>
|
|
|
|
<main class="layout">
|
|
<section class="card">
|
|
<h2>Neuer Anbau-Plan</h2>
|
|
<form method="post" action="/plans/create" class="grid">
|
|
<label>Planungsziel
|
|
<select name="target_ref" required>
|
|
<option value="">Bitte wählen</option>
|
|
{{range .PlanningTargets}}
|
|
<option value="{{.Ref}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Feldfrucht
|
|
<select name="crop_id" required>
|
|
<option value="">Bitte wählen</option>
|
|
{{range .Crops}}
|
|
<option value="{{.ID}}">{{.Name}} (Monat {{.SowStartMonth}}-{{.SowEndMonth}})</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Startmonat
|
|
<select name="start_month" required>
|
|
{{range .Months}}
|
|
<option value="{{.Value}}" {{if eq $.Settings.CurrentMonth .Value}}selected{{end}}>{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Zyklus-Offset
|
|
<select name="cycle_offset" required>
|
|
{{range .CycleOffsets}}
|
|
<option value="{{.Value}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Starttag
|
|
<input type="number" name="start_day" min="1" max="{{.Settings.DaysPerMonth}}" value="{{.Settings.CurrentDay}}" required>
|
|
</label>
|
|
<label class="full">Notiz
|
|
<input type="text" name="notes" maxlength="255">
|
|
</label>
|
|
<button type="submit">Plan speichern</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Aufgaben-Template speichern</h2>
|
|
<form method="post" action="/task-templates/create" class="grid">
|
|
<label class="full">Template-Titel
|
|
<input type="text" name="title" maxlength="140" placeholder="z.B. Schweine füttern" required>
|
|
</label>
|
|
<button type="submit">Template speichern</button>
|
|
</form>
|
|
<div class="table-wrap mt">
|
|
<table>
|
|
<thead><tr><th>Template</th><th>Aktion</th></tr></thead>
|
|
<tbody>
|
|
{{if .TaskTemplates}}
|
|
{{range .TaskTemplates}}
|
|
<tr>
|
|
<td>{{.Title}}</td>
|
|
<td>
|
|
<form method="post" action="/task-templates/delete">
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button type="submit" class="btn-small danger" onclick="return confirm('Template wirklich löschen?')">Löschen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="2">Keine Templates vorhanden.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Eigene Aufgabe einplanen</h2>
|
|
<form method="post" action="/custom-tasks/create" class="grid">
|
|
<label>Template (optional)
|
|
<select name="template_id">
|
|
<option value="0">Kein Template</option>
|
|
{{range .TaskTemplates}}
|
|
<option value="{{.ID}}">{{.Title}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Alternativer Titel
|
|
<input type="text" name="title" maxlength="140" placeholder="leer lassen wenn Template genutzt wird">
|
|
</label>
|
|
<label>Monat
|
|
<select name="month">
|
|
{{range .Months}}
|
|
<option value="{{.Value}}" {{if eq $.Settings.CurrentMonth .Value}}selected{{end}}>{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Tag
|
|
<input type="number" name="day" min="1" max="{{.Settings.DaysPerMonth}}" value="{{.Settings.CurrentDay}}">
|
|
</label>
|
|
<label>Zyklus-Offset
|
|
<select name="cycle_offset">
|
|
{{range .CycleOffsets}}
|
|
<option value="{{.Value}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Ziel (optional)
|
|
<input type="text" name="target_name" maxlength="120" placeholder="z.B. Hof oder Feld 1+2">
|
|
</label>
|
|
<label class="full">Notiz (optional)
|
|
<input type="text" name="notes" maxlength="255">
|
|
</label>
|
|
<button type="submit">Aufgabe einplanen</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="card full-width">
|
|
<h2>Geplante Durchläufe</h2>
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead><tr><th>Ziel</th><th>Frucht</th><th>Aussaat</th><th>Ernte</th><th>Notiz</th><th>Aktion</th></tr></thead>
|
|
<tbody>
|
|
{{if .Plans}}
|
|
{{range .Plans}}
|
|
<tr>
|
|
<td>{{.TargetName}}</td>
|
|
<td>{{.CropName}}</td>
|
|
<td>Monat {{.StartMonth}} Tag {{.StartDay}} (Zyklus {{.StartCycle}})</td>
|
|
<td>Monat {{.HarvestMonth}} Tag {{.HarvestDay}} (Zyklus {{.HarvestCycle}})</td>
|
|
<td>{{.Notes}}</td>
|
|
<td>
|
|
<form method="post" action="/plans/delete">
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button type="submit" class="btn-small danger" onclick="return confirm('Plan wirklich löschen?')">Löschen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="6">Keine Planung vorhanden.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card full-width">
|
|
<h2>Eigene Aufgaben</h2>
|
|
<div class="table-wrap">
|
|
<table>
|
|
<thead><tr><th>Titel</th><th>Ziel</th><th>Datum</th><th>Notiz</th><th>Aktion</th></tr></thead>
|
|
<tbody>
|
|
{{if .CustomTasks}}
|
|
{{range .CustomTasks}}
|
|
<tr>
|
|
<td>{{.Title}}</td>
|
|
<td>{{if .TargetName}}{{.TargetName}}{{else}}Allgemein{{end}}</td>
|
|
<td>Monat {{.Month}} Tag {{.Day}} (Zyklus {{.Cycle}})</td>
|
|
<td>{{.Notes}}</td>
|
|
<td>
|
|
<form method="post" action="/custom-tasks/delete">
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button type="submit" class="btn-small danger" onclick="return confirm('Aufgabe wirklich löschen?')">Löschen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="5">Keine eigenen Aufgaben geplant.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
{{if .Error}}<div class="toast error">{{.Error}}</div>{{end}}
|
|
{{if .Info}}<div class="toast info">{{.Info}}</div>{{end}}
|
|
</body>
|
|
</html>
|