Add product features, Heleket crypto payments and order status icons.
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user