Add themed UI, favicon, plan deletion, regrow cycles, and crop prep/post tasks

This commit is contained in:
Kai
2026-02-16 13:27:47 +01:00
parent 51181a83c8
commit a1c1ef31a3
14 changed files with 552 additions and 127 deletions

View File

@@ -4,10 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FarmCal - Feldfruechte</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>FarmCal</h1><p>Feldfruechte verwalten</p></header>
<header class="top"><h1><img src="/static/farmcal-icon.svg" alt="" class="brand-icon">FarmCal</h1><p>Feldfruechte verwalten</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>
@@ -24,6 +25,10 @@
<label>Aussaat von Monat<input type="number" name="sow_start_month" min="1" max="12" required></label>
<label>Aussaat bis Monat<input type="number" name="sow_end_month" min="1" max="12" required></label>
<label>Wachstum (Monate)<input type="number" name="grow_months" min="1" max="24" required></label>
<label class="check"><input type="checkbox" name="regrow_enabled"> Waechst nach Ernte erneut</label>
<label>Zusatz-Ernten (0 = unendlich)
<input type="number" name="regrow_cycles" min="0" max="120" value="0">
</label>
<button type="submit">Anlegen</button>
</form>
</section>
@@ -44,7 +49,11 @@
<span>bis</span>
<input type="number" name="sow_end_month" min="1" max="12" value="{{.SowEndMonth}}" required>
</td>
<td><input type="number" name="grow_months" min="1" max="24" value="{{.GrowMonths}}" required></td>
<td>
<input type="number" name="grow_months" min="1" max="24" value="{{.GrowMonths}}" required>
<label class="check mt-xs"><input type="checkbox" name="regrow_enabled" {{if .RegrowEnabled}}checked{{end}}> Regrow</label>
<input type="number" name="regrow_cycles" min="0" max="120" value="{{.RegrowCycles}}" title="0 = unendlich">
</td>
<td class="actions">
<button type="submit" class="btn-small">Speichern</button>
<button type="submit" formaction="/crops/delete" formnovalidate class="btn-small danger" onclick="return confirm('Feldfrucht wirklich loeschen?')">Loeschen</button>
@@ -59,6 +68,59 @@
</table>
</div>
</section>
<section class="card full-width">
<h2>Vor- und Nachbereitung je Feldfrucht</h2>
<form method="post" action="/crop-steps/create" class="grid">
<label>Feldfrucht
<select name="crop_id" required>
<option value="">Bitte waehlen</option>
{{range .Crops}}
<option value="{{.ID}}">{{.Name}}</option>
{{end}}
</select>
</label>
<label>Phase
<select name="phase" required>
<option value="pre">Vorbereitung (vor Aussaat)</option>
<option value="post">Nachbereitung (nach Ernte)</option>
</select>
</label>
<label>Monats-Offset
<input type="number" name="month_offset" min="0" max="24" value="0" required>
</label>
<label class="full">Aufgabe
<input type="text" name="title" maxlength="140" required placeholder="z.B. Kalken oder Mulchen">
</label>
<button type="submit">Schritt speichern</button>
</form>
<div class="table-wrap mt">
<table>
<thead><tr><th>Feldfrucht</th><th>Phase</th><th>Offset</th><th>Aufgabe</th><th>Aktion</th></tr></thead>
<tbody>
{{if .CropSteps}}
{{range .CropSteps}}
<tr>
<td>{{.CropName}}</td>
<td>{{if eq .Phase "pre"}}Vorbereitung{{else}}Nachbereitung{{end}}</td>
<td>{{.MonthOffset}}</td>
<td>{{.Title}}</td>
<td>
<form method="post" action="/crop-steps/delete">
<input type="hidden" name="id" value="{{.ID}}">
<button type="submit" class="btn-small danger" onclick="return confirm('Schritt loeschen?')">Loeschen</button>
</form>
</td>
</tr>
{{end}}
{{else}}
<tr><td colspan="5">Keine Schritte vorhanden.</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}}

View File

@@ -4,11 +4,12 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FarmCal - Dashboard</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>FarmCal</h1>
<h1><img src="/static/farmcal-icon.svg" alt="" class="brand-icon">FarmCal</h1>
<p>Dashboard</p>
</header>

View File

@@ -4,10 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FarmCal - Felder</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>FarmCal</h1><p>Felder und Feldgruppen</p></header>
<header class="top"><h1><img src="/static/farmcal-icon.svg" alt="" class="brand-icon">FarmCal</h1><p>Felder und Feldgruppen</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>

View File

@@ -4,10 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FarmCal - Allgemein</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>FarmCal</h1><p>Allgemeine Einstellungen</p></header>
<header class="top"><h1><img src="/static/farmcal-icon.svg" alt="" class="brand-icon">FarmCal</h1><p>Allgemeine Einstellungen</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>

View File

@@ -4,10 +4,11 @@
<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>FarmCal</h1><p>Anbau planen</p></header>
<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>
@@ -57,7 +58,7 @@
<h2>Geplante Durchlaeufe</h2>
<div class="table-wrap">
<table>
<thead><tr><th>Ziel</th><th>Frucht</th><th>Aussaat</th><th>Ernte</th><th>Notiz</th></tr></thead>
<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}}
@@ -67,10 +68,16 @@
<td>Monat {{.StartMonth}} Tag {{.StartDay}}</td>
<td>Monat {{.HarvestMonth}} Tag {{.HarvestDay}}</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 loeschen?')">Loeschen</button>
</form>
</td>
</tr>
{{end}}
{{else}}
<tr><td colspan="5">Keine Planung vorhanden.</td></tr>
<tr><td colspan="6">Keine Planung vorhanden.</td></tr>
{{end}}
</tbody>
</table>