feat: tepmlate for all person bricks

and separate page for temporary template viewing
This commit is contained in:
efim
2023-11-16 03:53:25 +00:00
parent 4764300d08
commit 9f4fe20979
3 changed files with 189 additions and 71 deletions

View File

@@ -237,54 +237,3 @@ func roomPageRoute(
}
}
func roomTemplatesPreview(
templateFs *embed.FS,
) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
type BrickData struct {
ColorClass template.CSS
Name string
}
contentData := struct {
Bricks []BrickData
}{
Bricks: []BrickData{
{
Name: "expand",
ColorClass: "--expand-color",
},
{
Name: "probing question",
ColorClass: "--probing-q-color",
},
{
Name: "change topic",
ColorClass: "--change-topic-color",
},
{
Name: "clarifying question",
ColorClass: "--clarifying-q-color",
},
{
Name: "meta",
ColorClass: "--meta-color",
},
},
}
pageData := pageData{
Header: headerData{Title: "look at the room templates"},
Content: contentData,
}
baseFile := "templates/base.gohtml"
tmpl := template.Must(template.ParseFS(templateFs, baseFile, "templates/tableTemplates.gohtml"))
err := tmpl.ExecuteTemplate(w, "full-page", pageData)
if err != nil {
log.Printf("yoyo, error %s", err)
}
}
}