Implement file upload for replies

This commit is contained in:
Dominic Ferrando
2025-04-18 15:41:29 -04:00
parent 00c8057b5b
commit a80a7a4dba
6 changed files with 188 additions and 130 deletions
+14 -14
View File
@@ -3,22 +3,22 @@ package views
import "fmt"
type CatalogThreadPreview struct {
Subject string
Body string
ThreadURL string
MediaPath string
Subject string
Body string
ThreadURL string
MediaPath string
}
templ ThreadsCatalog(previews []CatalogThreadPreview) {
<div id="catalog">
for _, preview := range previews {
<div class="catalog-preview">
<a href={ templ.SafeURL(preview.ThreadURL) }>
<img class="catalog-preview-img" src={ fmt.Sprintf("/static/img/posts/%s", preview.MediaPath) } />
</a>
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-preview-link">{ preview.Subject }</a></h1>
<p>{ preview.Body }</p>
<div id="catalog">
for _, preview := range previews {
<div class="catalog-preview">
<a href={ templ.SafeURL(preview.ThreadURL) }>
<img class="catalog-preview-img" src={ fmt.Sprintf("/static/img/posts/%s", preview.MediaPath) }/>
</a>
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-preview-link">{ preview.Subject }</a></h1>
<p>{ preview.Body }</p>
</div>
}
</div>
}
</div>
}