Added forgotten quoting for visitor's messages. And made it into a mixin for future expansion.

This commit is contained in:
Alexander Andreev 2021-09-26 22:41:37 +04:00
parent dd3d818f04
commit 9e88e1be35
Signed by: Arav
GPG Key ID: 610DF2574456329F

View File

@ -1,5 +1,11 @@
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')
@ -35,16 +41,13 @@ block content
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")
p= line
+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")
if (line[0] == ">")
p.quote= line
else
p= line
+entryLine(line)
else
if (posts === null)
p.center Cannot establish database connection.