Add product features, Heleket crypto payments and order status icons.

This commit is contained in:
shop
2026-06-27 16:29:33 +03:00
parent 361d35e6b4
commit 98a0bb01e2
31 changed files with 1673 additions and 126 deletions
+11
View File
@@ -32,6 +32,7 @@ func ParseTemplates() (*template.Template, error) {
"effective": effectivePrice,
"safeHTML": func(s string) template.HTML { return template.HTML(s) },
"orderLabel": orderstatus.Label,
"orderIcon": orderstatus.Icon,
"orderClass": orderstatus.Class,
"orderStep": orderstatus.Step,
"orderTimeline": func() []string { return orderstatus.Timeline },
@@ -44,6 +45,16 @@ func ParseTemplates() (*template.Template, error) {
},
"orderTerminal": orderstatus.IsTerminal,
"orderNorm": orderstatus.Normalize,
"historyBarPct": func(price, max float64) int {
if max <= 0 {
return 20
}
pct := int(price / max * 100)
if pct < 8 {
return 8
}
return pct
},
"catSelected": func(catID int, productCatID *int) bool {
return productCatID != nil && *productCatID == catID
},