Small code cleanup

This commit is contained in:
Dominic Ferrando
2025-04-18 12:48:18 -04:00
parent d57a83dedc
commit dc104b55e1
6 changed files with 49 additions and 44 deletions
+3 -3
View File
@@ -13,11 +13,11 @@ templ NewThreadForm(board database.Board) {
then trigger refreshThreads on body">
<table>
<tbody>
<tr class="new-thread-form-field">
<tr class="new-post-form-field">
<th>Subject</th>
<td><input name="subject" /></td>
</tr>
<tr class="new-thread-form-field">
<tr class="new-post-form-field">
<th>Comment</th>
<td><textarea name="body" required></textarea></td>
</tr>
@@ -40,7 +40,7 @@ templ BoardHeader(board database.Board) {
templ Board(board database.Board) {
@shared.Layout() {
@BoardHeader(board)
<div class="new-thread-container">
<div class="new-post-container">
<button _="on click
hide me
then show #newThreadForm" id="newThreadBtn">[New Thread]</button>
+2 -2
View File
@@ -10,11 +10,11 @@ import (
templ Thread(board database.Board, thread database.Thread, posts []database.Post) {
@shared.Layout() {
@BoardHeader(board)
<div class="new-thread-container">
<div class="new-post-container">
<form id="newPostForm" hx-swap="none" hx-post={ fmt.Sprintf("/%s/threads/%d", board.Slug, thread.Id) }>
<table>
<tbody>
<tr class="new-thread-form-field">
<tr class="new-post-form-field">
<th>Comment</th>
<td><textarea name="body" required></textarea></td>
</tr>
+2 -2
View File
@@ -9,8 +9,8 @@ ThreadURL string
templ ThreadsCatalog(previews []CatalogThreadPreview) {
<div id="catalog">
for _, preview := range previews {
<div class="catalog-post">
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-post-link">{ preview.Subject }</a></h1>
<div class="catalog-preview">
<h1><a href={ templ.SafeURL(preview.ThreadURL) } class="catalog-preview-link">{ preview.Subject }</a></h1>
<p>{ preview.Body }</p>
</div>
}