läuft
This commit is contained in:
39
templates/dashboard.gohtml
Normal file
39
templates/dashboard.gohtml
Normal file
@@ -0,0 +1,39 @@
|
||||
{{define "title"}}Dashboard – Kücheninventar{{end}}
|
||||
{{define "content"}}
|
||||
<section class="card">
|
||||
<h2>Nächste ablaufende Einheit</h2>
|
||||
{{if .Next}}
|
||||
<div class="flex-between">
|
||||
<div>
|
||||
<strong>{{.Next.Product.Name}}</strong>
|
||||
{{if .Next.Product.Manufacturer}}<span class="muted">– {{.Next.Product.Manufacturer}}</span>{{end}}<br/>
|
||||
<span>Ablaufdatum: {{dateHuman .Next.ExpiryDate}}</span>
|
||||
</div>
|
||||
<form method="post" action="/units/{{.Next.ID}}/checkout?from=/">
|
||||
<button class="btn danger">Ausbuchen</button>
|
||||
</form>
|
||||
</div>
|
||||
{{else}}
|
||||
<p class="muted">Keine Einheiten auf Lager.</p>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
|
||||
<section class="card">
|
||||
<h2>Produkte</h2>
|
||||
<div class="grid">
|
||||
{{range .Products}}
|
||||
<a class="product" href="/products/{{.ID}}">
|
||||
{{if .ImagePath}}<img src="{{.ImagePath}}" alt="{{.Name}}"/>
|
||||
{{else}}<div class="placeholder">Kein Bild</div>{{end}}
|
||||
<div class="meta">
|
||||
<div class="name">{{.Name}}</div>
|
||||
{{if .Manufacturer}}<div class="muted">{{.Manufacturer}}</div>{{end}}
|
||||
<div class="stock {{if and (gt .MinStock 0) (lt .CurrentStock .MinStock)}}warn{{end}}">Bestand: {{.CurrentStock}}{{if gt .MinStock 0}} / Min {{.MinStock}}{{end}}</div>
|
||||
</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="actions"><a class="btn" href="/products/create">+ Produkt anlegen</a></div>
|
||||
</section>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user