get adding threads working
This commit is contained in:
+11
-9
@@ -3,15 +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 PostsGrid(vms []ThreadGridBoxViewModel) {
|
||||
for _, vm := range vms {
|
||||
<div class="thread-catalog-post">
|
||||
<h1>{ vm.Thread.Subject }</h1>
|
||||
<p>{ vm.Posts[0].Body }</p>
|
||||
</div>
|
||||
}
|
||||
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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user