64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
extends base.pug
|
|
|
|
mixin entryLine(line)
|
|
if (line[0] == ">")
|
|
p.quote= line
|
|
else
|
|
p= line
|
|
|
|
block head
|
|
link(href='/assets/css/guestbook.css' rel='stylesheet')
|
|
|
|
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='E-Mail (optional)' name='email')
|
|
input(type='text' maxlength='255' placeholder='Website (optional)' name='website')
|
|
textarea(maxlength='4096' placeholder='Your message' name='message' required)
|
|
span.checkboxes
|
|
span.checkbox
|
|
input(type='checkbox' id='hide-email' name='hide_email' checked)
|
|
label(for='hide-email') Hide E-Mail*
|
|
span.checkbox
|
|
input(type='checkbox' id='hide-website' name='hide_website' checked)
|
|
label(for='hide-website') Hide website*
|
|
span.captcha
|
|
input(type='hidden', name='captcha_id' value=captcha_id)
|
|
img(src='/captcha/'+captcha_id+'/image', alt="CAPTCHA" width='160' height='40')
|
|
input(type='text' maxlength='6' placeholder='CAPTCHA' name='captcha_answer')
|
|
small Will be valid for next #[b 5] minutes.
|
|
small *Only I can see if set.
|
|
input(type='submit' value='Send a post')
|
|
section#posts
|
|
if (posts)
|
|
each post in posts
|
|
article
|
|
header
|
|
| Posted by #[span.highlighted= post.name] #{post.email} #{post.website} on #[time(datetime=post.created)= date_(post.created, tz)]
|
|
each line in post.message.split("\n")
|
|
+entryLine(line)
|
|
if post.feedback
|
|
.feedback
|
|
header
|
|
| Feedback by #[span.highlighted #{owner}] on #[time(datetime=post.feedback_created)= date_(post.feedback_created, tz)]
|
|
each line in post.feedback.split("\n")
|
|
+entryLine(line)
|
|
else
|
|
if (posts === null)
|
|
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++
|