Dwelling/homepage/views/guestbook.pug

59 lines
1.9 KiB
Plaintext
Raw Normal View History

2021-02-10 01:01:50 +04:00
extends base.pug
mixin entryLine(line)
if (line[0] == ">")
p.quote= line
else
p= line
2021-02-10 01:01:50 +04:00
block head
link(href='/assets/css/guestbook.css' rel='stylesheet')
script(src='/assets/js/captcha_refresh.js' defer='')
2021-02-10 01:01:50 +04:00
block nav
nav
a(href='/') Home
a(href='/stuff') Stuff
a(href='/mindflow') Mindflow
a(href='/about') About
h1 Guestbook
block content
form#new-post(action='/guestbook', method='POST')
input(type='text' maxlength='80' placeholder='Name (Anonymous if left blank)' name='name')
input(type='text' maxlength='255' placeholder='Website (optional)' name='website')
textarea(maxlength='4096' placeholder='Your message' name='message' required)
span.checkboxes
2022-10-26 01:49:24 +04:00
input(type='checkbox' id='hide-website' name='hide_website' checked)
label(for='hide-website') Hide website #[small (only I can see if set)]
2022-06-25 03:26:41 +04:00
span.captcha
2022-10-26 01:49:24 +04:00
input(type='hidden' value=captcha_id name='captcha_id')
img(src='/api/captcha/'+captcha_id+'/image', alt="CAPTCHA" width='160' height='40')
input(type='text' maxlength='6' placeholder='CAPTCHA' name='captcha_answer' required)
small Valid for #[b 10] minutes.
2021-02-10 01:01:50 +04:00
input(type='submit' value='Send a post')
section#posts
if (posts)
each post in posts
article
header
2022-10-10 03:28:03 +04:00
| Post ##{post.post_id} by #[span.highlighted= post.name] #{post.website} on #[time(datetime=post.created)= date_(post.created, tz)]
2021-02-10 01:01:50 +04:00
each line in post.message.split("\n")
+entryLine(line)
2021-02-10 01:01:50 +04:00
if post.feedback
.reply
2021-02-10 01:01:50 +04:00
header
| Reply by #[span.highlighted #{owner}] on #[time(datetime=post.feedback_created)= date_(post.feedback_created, tz)]
2021-02-10 01:01:50 +04:00
each line in post.feedback.split("\n")
+entryLine(line)
2021-02-10 01:01:50 +04:00
else
if (posts === null)
2021-02-10 01:01:50 +04:00
p.center Cannot establish database connection.
else
p.center No posts.
if pages_count > 1
section#pagination
- let n = 1;
while n <= pages_count
a(href='/guestbook?p='+n)= n++