Add footer

This commit is contained in:
Dominic Ferrando
2025-04-23 22:07:16 -04:00
parent 71466e8f53
commit f04db77087
5 changed files with 27 additions and 7 deletions
+1
View File
@@ -118,4 +118,5 @@ templ ThreadsCatalog(previews []CatalogThreadPreview, catalogContext CatalogCont
</div>
}
</div>
<hr/>
}
+3
View File
@@ -28,5 +28,8 @@ templ Layout() {
</div>
{ children... }
</body>
<footer>
<p>All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.</p>
</footer>
</html>
}
+12 -7
View File
@@ -185,6 +185,15 @@ type ThreadContext struct {
IsAdmin bool
}
templ ThreadActionBar(thread database.Thread) {
<hr/>
<div style="margin-left: 25px;">
<a href={ templ.URL("/" + thread.BoardSlug) } style="margin-right: 5px;" class="link-button">[Catalog]</a>
<a _="on click trigger refreshPosts on body" class="link-button">[Refresh]</a>
</div>
<hr/>
}
templ Thread(board database.Board, thread database.Thread, posts []database.Post, threadContext ThreadContext) {
@shared.Layout() {
<script src="/static/thread.js" defer></script>
@@ -192,19 +201,15 @@ templ Thread(board database.Board, thread database.Thread, posts []database.Post
<div class="new-post-container">
@shared.NewPostForm(board, fmt.Sprintf("/%s/threads/%d", board.Slug, thread.Id), false)
</div>
<hr/>
<div style="margin-left: 25px;">
<a href={ templ.URL("/" + thread.BoardSlug) } style="margin-right: 5px;" class="link-button">[Catalog]</a>
<a _="on click trigger refreshPosts on body" class="link-button">[Refresh]</a>
</div>
<hr/>
@ThreadActionBar(thread)
<div
class="thread"
hx-get={ fmt.Sprintf("/hx/%s/threads/%d/posts", thread.BoardSlug, thread.Id) }
hx-trigger="refreshPosts from:body"
_="on htmx:afterSwap call insertHeaderReplies()"
_="on htmx:afterSwap call insertHeaderReplies() then scrollToBottom()"
>
@Posts(posts, thread, threadContext)
</div>
@ThreadActionBar(thread)
}
}