{{define "title"}} Panel główny {{end}} {{define "main"}}
receipt_long Zamówienia dzisiaj {{len .Orders}} arrow_upward Wszystkie aktywne
cake Do realizacji {{$pending := 0}} {{range .Orders}}{{if ne .Status "done"}}{{$pending = add $pending 1}}{{end}}{{end}} {{$pending}} priority_high Oczekujące
check_circle Gotowe do odbioru {{$done := 0}} {{range .Orders}}{{if eq .Status "done"}}{{$done = add $done 1}}{{end}}{{end}} {{$done}} Zrealizowane
payments Przychód (szac.) {{$total := 0}} {{range .Orders}}{{range .Cakes}}{{$total = add $total (mult .Price .Amount)}}{{end}}{{end}} {{$total}} PLN trending_up W bieżącym miesiącu

list_alt Aktywne zamówienia

{{template "orders-table" .Orders}}
{{end}} {{define "orders-table"}} {{range .}} {{end}}
ID zamówienia Klient Data odbioru Pozycje Suma Status
#{{.ID}} {{.Surname}} {{.Name}}
{{.Phone}}
{{.Date.Format "2006-01-02 15:04"}} {{range $i, $c := .Cakes}}{{if $i}}, {{end}}{{.Name}} (x{{.Amount}}){{end}} {{.Total}} PLN {{if eq .Status "accepted"}}Przyjęte {{else if eq .Status "done"}}Gotowe {{else}}Oczekujące{{end}} edit
{{end}}