aboutsummaryrefslogtreecommitdiff
path: root/src/ui/pages/post
diff options
context:
space:
mode:
authorAlexander Kavon <me+git@alexkavon.com>2024-01-23 06:33:20 -0500
committerAlexander Kavon <me+git@alexkavon.com>2024-01-23 06:33:20 -0500
commit8d92bdf7da95e1085485c0e60b9dac19c246e235 (patch)
tree5c346f8bdb10b3b8084a3b9e95c727f7fa3914be /src/ui/pages/post
parent8510c36ded85740885e67b59ee2ec2360986c0a9 (diff)
move ui templates into src, update conf to handle other paths, export User Insert Hooks
Diffstat (limited to 'src/ui/pages/post')
-rw-r--r--src/ui/pages/post/create.tmpl.html20
-rw-r--r--src/ui/pages/post/get.tmpl.html26
2 files changed, 46 insertions, 0 deletions
diff --git a/src/ui/pages/post/create.tmpl.html b/src/ui/pages/post/create.tmpl.html
new file mode 100644
index 0000000..385ed22
--- /dev/null
+++ b/src/ui/pages/post/create.tmpl.html
@@ -0,0 +1,20 @@
+{{define "title"}}Create Post{{end}}
+
+{{define "main"}}
+ <h1>Whatcha Got?</h1>
+ <form action="/p" method="POST">
+ <label>
+ Title
+ <input type="text" placeholder="NYC Voted Best Place to Live By NYers" name="title" />
+ <span>Title will be automatically pulled from URL if not provided.</span>
+ </label>
+ <label>
+ Description
+ <textarea placeholder="Spit it out already." name="description"></textarea>
+ </label>
+ <label>
+ URL
+ <input type="url" placeholder="https://cheesy.pizza/01/01/1970/first-post" name="url" />
+ <button type="submit">Yup</button>
+ </form>
+{{end}}
diff --git a/src/ui/pages/post/get.tmpl.html b/src/ui/pages/post/get.tmpl.html
new file mode 100644
index 0000000..b32bd1c
--- /dev/null
+++ b/src/ui/pages/post/get.tmpl.html
@@ -0,0 +1,26 @@
+{{define "title"}}{{.post.Title}}{{end}}
+
+{{define "main"}}
+ <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 .post.Description.Valid }}
+ <p>{{.post.Description.String}}</p>
+ {{end}}
+ <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>
+ </form>
+ {{template "comments" .}}
+{{end}}