render thread catalog posts

This commit is contained in:
Dominic Ferrando
2025-04-18 01:09:49 -04:00
parent 0146a9583d
commit a8e1443f03
7 changed files with 305 additions and 62 deletions
+17
View File
@@ -0,0 +1,17 @@
package views
import "github.com/dominicf2001/comfychan/internal/database"
type ThreadGridBoxViewModel struct {
Thread database.Thread
Posts []database.Post
}
templ PostsGrid(vms []ThreadGridBoxViewModel) {
for _, vm := range vms {
<div class="thread-catalog-post">
<h1>{ vm.Thread.Subject }</h1>
<p>{ vm.Posts[0].Body }</p>
</div>
}
}