diff --git a/routes/room_page.go b/routes/room_page.go index bf6b9f9..d39a7a9 100644 --- a/routes/room_page.go +++ b/routes/room_page.go @@ -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( } } } - diff --git a/routes/templates/room.gohtml b/routes/templates/room.gohtml index b2fd9e2..bdfc99f 100644 --- a/routes/templates/room.gohtml +++ b/routes/templates/room.gohtml @@ -35,14 +35,18 @@
{{ block "simpleRoomShow" .Room }} -
{{ . }}
+
+
+ {{ template "roomPeople" . }} +
+
{{ end }}
diff --git a/routes/templates/tableTemplates.gohtml b/routes/templates/tableTemplates.gohtml index fc306d3..1ea0aee 100644 --- a/routes/templates/tableTemplates.gohtml +++ b/routes/templates/tableTemplates.gohtml @@ -1,4 +1,3 @@ -{{define "main-content"}}

Single templates

@@ -105,6 +104,3 @@
{{end}} - -{{end}} -