aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kavon <me+git@alexkavon.com>2024-01-22 21:59:17 -0500
committerAlexander Kavon <me+git@alexkavon.com>2024-01-22 21:59:17 -0500
commit0baaa2eaa759662363533b812ef5dd7cc25885e3 (patch)
tree908db0eeb1a835bdc7e465223e0d3beed7992a91
parent0cdc7a2e84ac5c460569a26a1dd8e3070cea487e (diff)
ui post/get and ui comments templates
-rw-r--r--ui/pages/post/get.tmpl.html22
-rw-r--r--ui/templates/comments.tmpl.html16
2 files changed, 38 insertions, 0 deletions
diff --git a/ui/pages/post/get.tmpl.html b/ui/pages/post/get.tmpl.html
new file mode 100644
index 0000000..1489f36
--- /dev/null
+++ b/ui/pages/post/get.tmpl.html
@@ -0,0 +1,22 @@
+{{define "title"}}{{.Title}}{{end}}
+
+{{define "main"}}
+ <a class="title" href="{{.Url}}" target="_blank">{{.Title}}</a>
+ <span class="post-tags">{{.Tags}}</span>
+ <span class="post-domain">{{.UrlDomainName}}</span>
+ <span class="post-author">by <a href="u/{{.Username}}">{{.Username}}</a></span>
+ <span class="post-date">{{.CreatedAt | relative}}</span>
+ <span class="actions">
+ <span class="action-flag">Flag</span>
+ <span class="action-hide">Hide</span>
+ </span>
+ {{ if .Description && !.Url }}
+ <p>{{.Description}}</p>
+ {{endif}}
+ <form action="/p/{{.ID}}/comment" method="POST">
+ <textarea placeholder="This better be good." name="comment"></textarea>
+ <button type="submit">Yup</button>
+ <button class="preview" type="button">Preview</button>
+ </form>
+ {{template "comments" .}}
+{{end}}
diff --git a/ui/templates/comments.tmpl.html b/ui/templates/comments.tmpl.html
new file mode 100644
index 0000000..560e918
--- /dev/null
+++ b/ui/templates/comments.tmpl.html
@@ -0,0 +1,16 @@
+{{define "comments"}}
+<div id="post-comments">
+ {{range $comment := .comments }}
+ <span class="comment-author">by <a href="/u/{{$comment.username}}">{{$comment.username}}</a></span>
+ <span class="comment-created-at">{{$comment.created_at | relative_time}}</span>
+ <span class="actions">
+ <span class="action-flag">Flag</span>
+ <span class="action-hide">Hide</span>
+ <span class="action-reply">Reply</span>
+ </span>
+ <div class="c-alert c-alert--info" role="alert">
+ {{ $comment.body }}
+ </div>
+ {{ end }}
+</div>
+{{end}}