diff options
| author | Samuel Johnson <[email protected]> | 2025-11-25 19:47:20 -0500 |
|---|---|---|
| committer | Samuel Johnson <[email protected]> | 2025-11-25 19:47:20 -0500 |
| commit | 3c237fc659c2829042407697ca7aa3e1442a5719 (patch) | |
| tree | 6557b2faa27eb9880ef96c8755bed3f8a461d2ae /ui/html | |
| parent | 368a462bc744d8e9084eacfaddeb9afcaf7f7133 (diff) | |
Add post editing interface
Diffstat (limited to 'ui/html')
| -rw-r--r-- | ui/html/base.tmpl.html | 2 | ||||
| -rw-r--r-- | ui/html/pages/index.tmpl.html | 27 | ||||
| -rw-r--r-- | ui/html/pages/login.tmpl.html (renamed from ui/html/login.tmpl.html) | 5 | ||||
| -rw-r--r-- | ui/html/pages/post.tmpl.html | 8 |
4 files changed, 37 insertions, 5 deletions
diff --git a/ui/html/base.tmpl.html b/ui/html/base.tmpl.html index 014868e..9ff8489 100644 --- a/ui/html/base.tmpl.html +++ b/ui/html/base.tmpl.html @@ -8,7 +8,7 @@ <meta property="og:type" content="object" /> <meta property="og:title" content="Paterissa - thehinterlander's blog" /> <meta property="og:url" content="https://paterissa.net" /> - <meta property="og:description" content="thehinterlander's repository of musings" /> + <meta property="og:description" content={{template "description" .}} /> <title>{{template "title" .}} - Paterissa</title> <link rel="stylesheet" href="/static/get?file=app.css"> </head> 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/login.tmpl.html b/ui/html/pages/login.tmpl.html index 6377dc0..6eb303a 100644 --- a/ui/html/login.tmpl.html +++ b/ui/html/pages/login.tmpl.html @@ -1,4 +1,5 @@ {{define "title"}}Login{{end}} +{{define "description"}}Login Portal{{end}} {{define "main"}} <div class="topline"> @@ -13,7 +14,9 @@ <label for="pass_two">Password:</label> <input type="text" id="pass_two" name="pass_two"> <br> - <input type="submit" value="Submit"> + <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}} |
