298 lines
9.9 KiB
HTML
298 lines
9.9 KiB
HTML
<!doctype html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>FarmCal</title>
|
|
<link rel="stylesheet" href="/static/styles.css">
|
|
</head>
|
|
<body>
|
|
<header class="top">
|
|
<h1>FarmCal</h1>
|
|
<p>Planung fuer Felder, Feldgruppen, Aussaat und Ernte</p>
|
|
</header>
|
|
|
|
<main class="layout">
|
|
<section class="card">
|
|
<h2>Ingame-Zeit</h2>
|
|
<form method="get" action="/" class="grid">
|
|
<label>Monat
|
|
<select name="month">
|
|
{{range .Months}}
|
|
<option value="{{.Value}}" {{if eq $.NowMonth .Value}}selected{{end}}>{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Tag
|
|
<input type="number" name="day" min="1" max="{{.DaysPerMonth}}" value="{{.NowDay}}">
|
|
</label>
|
|
<button type="submit">Anzeigen</button>
|
|
</form>
|
|
<form method="post" action="/settings" class="grid mt">
|
|
<label>Tage pro Monat
|
|
<input type="number" name="days_per_month" min="1" max="31" value="{{.DaysPerMonth}}">
|
|
</label>
|
|
<button type="submit">Speichern</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Heutige Aufgaben</h2>
|
|
{{if .Tasks}}
|
|
<ul class="tasks">
|
|
{{range .Tasks}}
|
|
<li><strong>{{.Type}}:</strong> {{.Message}}</li>
|
|
{{end}}
|
|
</ul>
|
|
{{else}}
|
|
<p>Keine Aufgaben fuer diesen Ingame-Tag.</p>
|
|
{{end}}
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Felder verwalten</h2>
|
|
<form method="post" action="/fields/create" class="grid">
|
|
<label>Feldnummer
|
|
<input type="number" name="number" min="1" required>
|
|
</label>
|
|
<label>Name (optional)
|
|
<input type="text" name="name" maxlength="120">
|
|
</label>
|
|
<label class="check">
|
|
<input type="checkbox" name="owned">
|
|
Im Besitz
|
|
</label>
|
|
<button type="submit">Feld anlegen</button>
|
|
</form>
|
|
|
|
<div class="table-wrap mt">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Nummer</th>
|
|
<th>Name</th>
|
|
<th>Besitz</th>
|
|
<th>Gruppe</th>
|
|
<th>Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{if .Fields}}
|
|
{{range .Fields}}
|
|
<tr>
|
|
<form method="post" action="/fields/update">
|
|
<td>
|
|
Feld {{.Number}}
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
</td>
|
|
<td><input type="text" name="name" value="{{.Name}}" maxlength="120"></td>
|
|
<td>
|
|
<label class="check">
|
|
<input type="checkbox" name="owned" {{if .Owned}}checked{{end}}>
|
|
Im Besitz
|
|
</label>
|
|
</td>
|
|
<td>{{if .GroupName}}{{.GroupName}}{{else}}-{{end}}</td>
|
|
<td class="actions">
|
|
<button type="submit" class="btn-small">Speichern</button>
|
|
</form>
|
|
<form method="post" action="/fields/delete" onsubmit="return confirm('Feld wirklich loeschen?');">
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button type="submit" class="btn-small danger">Loeschen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="5">Noch keine Felder vorhanden.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Feldgruppen</h2>
|
|
<form method="post" action="/field-groups/create" class="grid">
|
|
<label class="full">Name (optional)
|
|
<input type="text" name="name" maxlength="120" placeholder="z.B. Feld 1+2">
|
|
</label>
|
|
<label class="full">Felder (1 bis X)
|
|
<select name="field_ids" multiple size="6">
|
|
{{range .Fields}}
|
|
<option value="{{.ID}}">Feld {{.Number}}{{if .Name}} ({{.Name}}){{end}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<button type="submit">Gruppe speichern</button>
|
|
</form>
|
|
<p class="hint">Mehrfachauswahl: mit Strg/Cmd klicken.</p>
|
|
|
|
<div class="table-wrap mt">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Felder</th>
|
|
<th>Aktion</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{if .Groups}}
|
|
{{range .Groups}}
|
|
<tr>
|
|
<td>{{.Name}}</td>
|
|
<td>{{.Numbers}}</td>
|
|
<td>
|
|
<form method="post" action="/field-groups/delete" onsubmit="return confirm('Gruppe aufloesen?');">
|
|
<input type="hidden" name="group_key" value="{{.Key}}">
|
|
<button type="submit" class="btn-small danger">Aufloesen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="3">Noch keine Feldgruppen vorhanden.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Feldfruechte verwalten</h2>
|
|
<form method="post" action="/crops/create" class="grid">
|
|
<label>Name
|
|
<input type="text" name="name" maxlength="80" required>
|
|
</label>
|
|
<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>
|
|
<button type="submit">Feldfrucht anlegen</button>
|
|
</form>
|
|
|
|
<div class="table-wrap mt">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Aussaat</th>
|
|
<th>Wachstum</th>
|
|
<th>Aktionen</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{if .Crops}}
|
|
{{range .Crops}}
|
|
<tr>
|
|
<form method="post" action="/crops/update">
|
|
<td>
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<input type="text" name="name" value="{{.Name}}" maxlength="80" required>
|
|
</td>
|
|
<td class="inline-inputs">
|
|
<input type="number" name="sow_start_month" min="1" max="12" value="{{.SowStartMonth}}" required>
|
|
<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 class="actions">
|
|
<button type="submit" class="btn-small">Speichern</button>
|
|
</form>
|
|
<form method="post" action="/crops/delete" onsubmit="return confirm('Feldfrucht wirklich loeschen?');">
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button type="submit" class="btn-small danger">Loeschen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="4">Keine Feldfruechte vorhanden.</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="card">
|
|
<h2>Anbau planen</h2>
|
|
<form method="post" action="/plans/create" class="grid">
|
|
<label>Planungsziel
|
|
<select name="target_ref" required>
|
|
<option value="">Bitte waehlen</option>
|
|
{{range .PlanningTargets}}
|
|
<option value="{{.Ref}}">{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Feldfrucht
|
|
<select name="crop_id" required>
|
|
<option value="">Bitte waehlen</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 $.NowMonth .Value}}selected{{end}}>{{.Label}}</option>
|
|
{{end}}
|
|
</select>
|
|
</label>
|
|
<label>Starttag
|
|
<input type="number" name="start_day" min="1" max="{{.DaysPerMonth}}" value="{{.NowDay}}" 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>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>
|
|
<tbody>
|
|
{{if .Plans}}
|
|
{{range .Plans}}
|
|
<tr>
|
|
<td>{{.TargetName}}</td>
|
|
<td>{{.CropName}}</td>
|
|
<td>Monat {{.StartMonth}} Tag {{.StartDay}}</td>
|
|
<td>Monat {{.HarvestMonth}} Tag {{.HarvestDay}}</td>
|
|
<td>{{.Notes}}</td>
|
|
</tr>
|
|
{{end}}
|
|
{{else}}
|
|
<tr><td colspan="5">Noch keine Planung 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}}
|
|
</body>
|
|
</html>
|