aboutsummaryrefslogtreecommitdiff
path: root/src/ui/templates
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/templates
parent8510c36ded85740885e67b59ee2ec2360986c0a9 (diff)
move ui templates into src, update conf to handle other paths, export User Insert Hooks
Diffstat (limited to 'src/ui/templates')
-rw-r--r--src/ui/templates/base.tmpl.html14
-rw-r--r--src/ui/templates/comments.tmpl.html16
-rw-r--r--src/ui/templates/messages.tmpl.html9
3 files changed, 39 insertions, 0 deletions
diff --git a/src/ui/templates/base.tmpl.html b/src/ui/templates/base.tmpl.html
new file mode 100644
index 0000000..a080925
--- /dev/null
+++ b/src/ui/templates/base.tmpl.html
@@ -0,0 +1,14 @@
+{{define "base"}}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <title>{{template "title" .}} | newsstand.nyc</title>
+ <link rel="stylesheet" href="https://unpkg.com/@blaze/css@x.x.x/dist/blaze/blaze.css">
+ <script src="https://unpkg.com/htmx.org@1.9.9" integrity="sha384-QFjmbokDn2DjBjq+fM+8LUIVrAgqcNW2s0PjAxHETgRn9l4fvX31ZxDxvwQnyMOX" crossorigin="anonymous"></script>
+</head>
+<body>
+ {{template "messages" .}}
+ {{template "main" .}}
+</body>
+</html>
+{{end}}
diff --git a/src/ui/templates/comments.tmpl.html b/src/ui/templates/comments.tmpl.html
new file mode 100644
index 0000000..b069bbd
--- /dev/null
+++ b/src/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}}</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}}
diff --git a/src/ui/templates/messages.tmpl.html b/src/ui/templates/messages.tmpl.html
new file mode 100644
index 0000000..dd5bfb1
--- /dev/null
+++ b/src/ui/templates/messages.tmpl.html
@@ -0,0 +1,9 @@
+{{define "messages"}}
+<div id="messages">
+ {{ if .message }}
+ <div class="c-alert c-alert--info" role="alert">
+ {{ .message }}
+ </div>
+ {{ end }}
+</div>
+{{end}}