package templates import ( "strconv" "git.bronku.xyz/bronku/cake-order-tracker/models" ) templ OrdersPage(first, last, today, tomorrow string, orders []models.Order) { @Layout("Panel główny", DateForm(first, last, today, tomorrow), OrdersMain(orders)) } templ DateForm(first, last, today, tomorrow string) {
} templ OrdersMain(orders []models.Order) {| ID zamówienia | Klient | Data odbioru | Pozycje | Suma | Status | |
|---|---|---|---|---|---|---|
| #{ strconv.Itoa(o.ID) } | { o.Surname } { o.Name } { o.Phone } |
{ o.Date.Format("2006-01-02 15:04") } | for i, c := range o.Cakes { if i > 0 { { ", " } } { c.Name } (x{ strconv.Itoa(c.Amount) }) } | { o.Total().String() } PLN | if o.Status == "accepted" { Przyjęte } else if o.Status == "done" { Gotowe } else { Oczekujące } | edit |