aboutsummaryrefslogtreecommitdiff
path: root/ui/html/pages
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-11-25 19:47:20 -0500
committerSamuel Johnson <[email protected]>2025-11-25 19:47:20 -0500
commit3c237fc659c2829042407697ca7aa3e1442a5719 (patch)
tree6557b2faa27eb9880ef96c8755bed3f8a461d2ae /ui/html/pages
parent368a462bc744d8e9084eacfaddeb9afcaf7f7133 (diff)
Add post editing interface
Diffstat (limited to 'ui/html/pages')
-rw-r--r--ui/html/pages/index.tmpl.html27
-rw-r--r--ui/html/pages/login.tmpl.html22
-rw-r--r--ui/html/pages/post.tmpl.html8
3 files changed, 54 insertions, 3 deletions
diff --git a/ui/html/pages/index.tmpl.html b/ui/html/pages/index.tmpl.html
index 011f964..ee0a0e0 100644
--- a/ui/html/pages/index.tmpl.html
+++ b/ui/html/pages/index.tmpl.html
@@ -1,7 +1,8 @@
{{define "title"}}Blog{{end}}
+{{define "description"}}"thehinterlander's repository of musings"{{end}}
{{define "main"}}
- <div class="flex-between">
+ <div class="flex_between">
<div class="topline">
<h2>Blog</h2>
<p>Home of {{.Name}}</p>
@@ -14,18 +15,38 @@
{{end}}
</div>
{{if .IsAuth}}
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
+ <script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
+ <script type="module" src="/static/get?file=mde.js"></script>
<div class="card">
<div class="header">
<h4><b>New</b></h4>
+ <form id="md_form" class="markdown_form">
+ <div class="white text_left">
+ <label for="raw"></label>
+ <input type="textarea" id="raw" name="raw" style="white-space: pre-wrap;">
+ </div>
+ <br>
+ <input type="submit" value="Post">
+ </form>
</div>
</div>
{{end}}
{{range .Rows}}
<div class="card">
<div class="header">
- <h4><b>{{.Name}} - {{.Time}}</b></h4>
+ <h4><b>{{.Name}} - {{.FormattedTime}}</b></h4>
</div>
- {{.Content}}
+ {{.Brief}}
+ <a href="/post?id={{.Id}}" class="nav_tag">View More</a>
</div>
{{end}}
+ <div class="flex_end bottom_elem">
+ <div class="right">
+ {{if ne .Offset 0}}
+ <a href="/?offset={{sub .Offset 10}}" class="nav_tag">Previous</a>
+ {{end}}
+ <a href="/?offset={{add .Offset 10}}">Next</a>
+ </div>
+ </div>
{{end}}
diff --git a/ui/html/pages/login.tmpl.html b/ui/html/pages/login.tmpl.html
new file mode 100644
index 0000000..6eb303a
--- /dev/null
+++ b/ui/html/pages/login.tmpl.html
@@ -0,0 +1,22 @@
+{{define "title"}}Login{{end}}
+{{define "description"}}Login Portal{{end}}
+
+{{define "main"}}
+ <div class="topline">
+ <h2>Log In</h2>
+ </div>
+ <div class="card">
+ <form class="login_form center" action="/login" method="POST">
+ <label for="user">Username:</label>
+ <input type="text" id="user" name="user">
+ <label for="pass_one">Password:</label>
+ <input type="text" id="pass_one" name="pass_one">
+ <label for="pass_two">Password:</label>
+ <input type="text" id="pass_two" name="pass_two">
+ <br>
+ <div class="right">
+ <input type="submit" value="Submit">
+ </div>
+ </form>
+ </div>
+{{end}}
diff --git a/ui/html/pages/post.tmpl.html b/ui/html/pages/post.tmpl.html
new file mode 100644
index 0000000..eefbd82
--- /dev/null
+++ b/ui/html/pages/post.tmpl.html
@@ -0,0 +1,8 @@
+{{define "title"}}{{.Post.Name}} - {{.Post.FormattedTime}}{{end}}
+{{define "description"}}{{.Post.Brief}}{{end}}
+
+{{define "main"}}
+ <div class="card">
+ {{.Post.Content}}
+ </div>
+{{end}}