From 9e88e1be35a8eba91b45dafd4df87d29042d0af4 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 26 Sep 2021 22:41:37 +0400 Subject: [PATCH] Added forgotten quoting for visitor's messages. And made it into a mixin for future expansion. --- homepage/views/guestbook.pug | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/homepage/views/guestbook.pug b/homepage/views/guestbook.pug index e56f32a..a6eec51 100644 --- a/homepage/views/guestbook.pug +++ b/homepage/views/guestbook.pug @@ -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.