fix template test renderer, add category
This commit is contained in:
parent
d9146750ba
commit
e4317ec4fd
15 changed files with 171 additions and 103 deletions
|
@ -2,14 +2,20 @@ package utils
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.sapphic.engineer/roleypoly/v4/types"
|
||||
"html/template"
|
||||
)
|
||||
|
||||
func RoleInputID(c *types.Category, r *types.Role) string {
|
||||
return fmt.Sprintf("category-%s_role-%s", c.ID, r.ID)
|
||||
func RoleInputID(c string, r string) string {
|
||||
return fmt.Sprintf("category-%s_role-%s", c, r)
|
||||
}
|
||||
|
||||
func RoleInputName(c *types.Category) string {
|
||||
return fmt.Sprintf("category_group_%s", c.ID)
|
||||
func RoleInputName(c string) string {
|
||||
return fmt.Sprintf("category_group_%s", c)
|
||||
}
|
||||
|
||||
func TemplateFuncs() template.FuncMap {
|
||||
return template.FuncMap{
|
||||
"roleInputID": RoleInputID,
|
||||
"roleInputName": RoleInputName,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue