package tpl import ( "html/template" "path/filepath" "management/internal/db/model/dto" ) func (r *render) btnFuncs() map[string]any { res := make(map[string]any, 3) res["genBtn"] = func(btns []*dto.OwnerMenuDto, actionNames ...string) template.HTML { if len(btns) == 0 { return template.HTML("") } var res string for _, action := range actionNames { for _, btn := range btns { base := filepath.Base(btn.Url) if base == action { res += `` } } } return template.HTML(res) } res["genLink"] = func(btns []*dto.OwnerMenuDto, actionNames ...string) template.HTML { if len(btns) == 0 { return template.HTML("") } var res string for _, action := range actionNames { for _, btn := range btns { base := filepath.Base(btn.Url) if base == action { res += `` } } } return template.HTML(res) } res["previewPicture"] = func(name string) template.HTML { var res string res += `` return template.HTML(res) } res["submitBtn"] = func(btns []*dto.OwnerMenuDto, actionNames ...string) template.HTML { if len(btns) == 0 { return template.HTML("") } var res string for _, action := range actionNames { for _, btn := range btns { base := filepath.Base(btn.Url) if base == action { res += `` } } } return template.HTML(res) } return res }