Implement dynamically getting board data

This commit is contained in:
Dominic Ferrando
2025-04-17 19:27:47 -04:00
parent 576cc763b0
commit e5b52712d1
16 changed files with 135 additions and 26 deletions
+42
View File
@@ -0,0 +1,42 @@
package views
import (
"fmt"
database "github.com/dominicf2001/comfychan/internal/database"
"github.com/dominicf2001/comfychan/web/views/shared"
)
templ NewThreadForm() {
<form style="display: none;" id="newThreadForm" style="display: ;">
<div>
<table>
<tbody>
<tr class="new-thread-form-field">
<th>Subject</th>
<td><input/></td>
</tr>
<tr class="new-thread-form-field">
<th>Comment</th>
<td><textarea></textarea></td>
</tr>
</tbody>
</table>
</div>
</form>
}
templ Board(board database.Board) {
@shared.Layout() {
<header class="board-header">
<img src="/static/img/banner-comfy.png"/>
<h1>
{ fmt.Sprintf("/%s/ - %s", board.Slug, board.Name) }
</h1>
<p>{ board.Tag }</p>
</header>
<div class="new-thread-container">
<button _="on click hide me then show #newThreadForm" id="newThreadBtn">[New Thread]</button>
@NewThreadForm()
</div>
}
}