feat: participant bricks in room added

This commit is contained in:
efim
2023-11-17 03:37:06 +00:00
parent 384afa0e00
commit 04ab19fadf
3 changed files with 18 additions and 9 deletions

View File

@@ -72,7 +72,12 @@ func streamingRoomStates(
w.Header().Set("Content-Type", "text/event-stream")
templFile := "templates/room.gohtml"
tmpl := template.Must(template.ParseFS(templateFs, templFile))
tableTemplates := "templates/tableTemplates.gohtml"
tmpl := template.Must(
template.New("").Funcs(template.FuncMap{
"bricksForPerson": bricksForPerson,
"personsFromRoom": personsFromRoom,
}).ParseFS(templateFs, tableTemplates, templFile))
roomStream := roomsM.Subscribe(r.Context(), roomName)
for room := range roomStream {
@@ -199,7 +204,12 @@ func roomPageRoute(
templFile := "templates/room.gohtml"
baseFile := "templates/base.gohtml"
tmpl := template.Must(template.ParseFS(templateFs, templFile, baseFile))
tableTemplates := "templates/tableTemplates.gohtml"
tmpl := template.Must(
template.New("").Funcs(template.FuncMap{
"bricksForPerson": bricksForPerson,
"personsFromRoom": personsFromRoom,
}).ParseFS(templateFs, tableTemplates, templFile, baseFile))
type GestureData struct {
Name string
@@ -236,4 +246,3 @@ func roomPageRoute(
}
}
}