refactor: data structs for template + method
enclosing rooms.Room into roomTableData, with methods to be used in tempalte to get other template related derived data structures
This commit is contained in:
@@ -65,13 +65,14 @@
|
||||
{{end}}
|
||||
|
||||
<h2>Now for a person</h2>
|
||||
<p>expected to be called with personData</p>
|
||||
{{ define "personBlocks" }}
|
||||
|
||||
<div class="person-bricks "
|
||||
id="person-{{.Index}}"
|
||||
style="--i: {{ .Index }}"
|
||||
>
|
||||
{{ range (bricksForPerson .) }}
|
||||
{{ range .BricksForPerson }}
|
||||
{{ template "brick" . }}
|
||||
{{ end }}
|
||||
<p>{{ .Name }}</p>
|
||||
@@ -81,8 +82,8 @@
|
||||
|
||||
|
||||
<h2>And now i'll want to get all persons for a room</h2>
|
||||
<p>expected be called with room *roomTableData</p>
|
||||
{{ define "roomPeople" }}
|
||||
{{ with (personsFromRoom .)}}
|
||||
<div
|
||||
class="circle-container relative"
|
||||
style="--tan: {{ .Tangens }}; --m: {{ .Total }};"
|
||||
@@ -91,5 +92,4 @@
|
||||
{{ template "personBlocks" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user