Some database refactoring

This commit is contained in:
Dominic Ferrando
2025-04-18 10:40:08 -04:00
parent ccc53447de
commit e53a65d437
8 changed files with 94 additions and 79 deletions
+9 -9
View File
@@ -3,17 +3,17 @@ package views
import "github.com/dominicf2001/comfychan/internal/database"
type ThreadGridBoxViewModel struct {
Thread database.Thread
Posts []database.Post
Thread database.Thread
Posts []database.Post
}
templ PostsCatalog(vms []ThreadGridBoxViewModel) {
<div id="catalog">
for _, vm := range vms {
<div class="thread-catalog-post">
<h1>{ vm.Thread.Subject }</h1>
<p>{ vm.Posts[0].Body }</p>
</div>
}
<div id="catalog">
for _, vm := range vms {
<div class="catalog-post">
<h1><a class="catalog-post-link">{ vm.Thread.Subject }</a></h1>
<p>{ vm.Posts[0].Body }</p>
</div>
}
</div>
}