diff options
| author | Samuel Johnson <[email protected]> | 2025-12-11 15:09:30 -0500 |
|---|---|---|
| committer | Samuel Johnson <[email protected]> | 2025-12-11 15:09:30 -0500 |
| commit | 61ba5dcc29a16bb3727209a76ee75fffff037dee (patch) | |
| tree | 4505ebfe8aadeae024e2f36fb948f9e79841a0f1 /ui/html/pages | |
| parent | 154e2a5417bca37cd7474f4e16fd8901844e473f (diff) | |
Add commenting system
Diffstat (limited to 'ui/html/pages')
| -rw-r--r-- | ui/html/pages/post.tmpl.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ui/html/pages/post.tmpl.html b/ui/html/pages/post.tmpl.html index eefbd82..d3b78f0 100644 --- a/ui/html/pages/post.tmpl.html +++ b/ui/html/pages/post.tmpl.html @@ -5,4 +5,40 @@ <div class="card"> {{.Post.Content}} </div> + <div class="card"> + <h3>Leave Comment</h3> + <form action="/comments/post?id={{.Post.Id}}" method="POST"> + <label for="comment"></label> + <textarea name="comment" id="comment" rows="5" class="w100" required></textarea><br><br> + <div class="flex-between"> + <label for="name">Name:</label> + <input type="text" name="name" id="name" required> + <input type="submit" value="Post"> + </div> + </form> + </div> + {{range .Comments}} + {{if .IsVerified}} + <div class="card"> + <h3>{{.Name}} - {{.FormattedTime}}</h3> + {{if $.IsAuth}} + <div class="nav_tag right"> + <a href="/comments/delete?id={{.Id}}" class="nav_tag right">Delete</a> + </div> + {{end}} + <p><pre>{{.Content}}</pre></p> + </div> + {{else}} + {{if $.IsAuth}} + <div class="card"> + <h3>{{.Name}} - {{.FormattedTime}}</h3> + <div class="nav_tag right"> + <a href="/comments/verify?id={{.Id}}" class="nav_tag right">Verify</a> + <a href="/comments/delete?id={{.Id}}" class="nav_tag right">Delete</a> + </div> + <p><pre>{{.Content}}</pre></p> + </div> + {{end}} + {{end}} + {{end}} {{end}} |
