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 extends base.pug
mixin entryLine(line)
if (line[0] == ">")
p.quote= line
else
p= line
block head block head
link(href='/assets/css/guestbook.css' rel='stylesheet') link(href='/assets/css/guestbook.css' rel='stylesheet')
@ -35,16 +41,13 @@ block content
header header
| Posted by #[span.highlighted= post.name] #{post.email} #{post.website} on #[time(datetime=post.created)= date_(post.created, tz)] | 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") each line in post.message.split("\n")
p= line +entryLine(line)
if post.feedback if post.feedback
.feedback .feedback
header header
| Feedback by #[span.highlighted #{owner}] on #[time(datetime=post.feedback_created)= date_(post.feedback_created, tz)] | Feedback by #[span.highlighted #{owner}] on #[time(datetime=post.feedback_created)= date_(post.feedback_created, tz)]
each line in post.feedback.split("\n") each line in post.feedback.split("\n")
if (line[0] == ">") +entryLine(line)
p.quote= line
else
p= line
else else
if (posts === null) if (posts === null)
p.center Cannot establish database connection. p.center Cannot establish database connection.