aboutsummaryrefslogtreecommitdiff
path: root/ui/pages/post
diff options
context:
space:
mode:
authorAlexander Kavon <me+git@alexkavon.com>2024-01-23 01:40:39 -0500
committerAlexander Kavon <me+git@alexkavon.com>2024-01-23 01:40:39 -0500
commit8510c36ded85740885e67b59ee2ec2360986c0a9 (patch)
treec8c4c70458bb65b0ee134f80cb364db851e9c7a2 /ui/pages/post
parentf329e7f2095a57967bfe86563401236d53a15924 (diff)
new tables: tags, post_tags, generated sqlboiler tags model, updated posts/get template, updated posts table to take nullable description and user_id foreign key
Diffstat (limited to 'ui/pages/post')
-rw-r--r--ui/pages/post/get.tmpl.html22
1 files changed, 13 insertions, 9 deletions
diff --git a/ui/pages/post/get.tmpl.html b/ui/pages/post/get.tmpl.html
index f705f65..b32bd1c 100644
--- a/ui/pages/post/get.tmpl.html
+++ b/ui/pages/post/get.tmpl.html
@@ -1,19 +1,23 @@
-{{define "title"}}{{.Title}}{{end}}
+{{define "title"}}{{.post.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}}</span>
+ <a class="title" href="{{.post.URL.String}}" target="_blank">{{.post.Title}}</a>
+ <span class="post-tags">
+ {{range $tag := .post.R.Tags}}
+ <span class="post-tag-{{$tag.Tag}}">{{$tag.Tag}}</span>
+ {{end}}
+ </span>
+ <span class="post-domain">{{.post.URL.String}} (Pretty URL)</span>
+ <span class="post-author">by <a href="u/{{.post.R.User.ID}}">{{.post.R.User.Username}}</a></span>
+ <span class="post-date">{{.post.CreatedAt.Format "Jan 02, 2006 15:04"}}</span>
<span class="actions">
<span class="action-flag">Flag</span>
<span class="action-hide">Hide</span>
</span>
- {{ if and .Description not .Url }}
- <p>{{.Description}}</p>
+ {{ if .post.Description.Valid }}
+ <p>{{.post.Description.String}}</p>
{{end}}
- <form action="/p/{{.ID}}/comment" method="POST">
+ <form action="/p/{{.post.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>