commit 4325b31043605dbd23caf80dfc3f028d6ae8de73 parent 3330ab0982aba59f0773be9561e109537cb427e0 Author: Decay <decaydjk@tilde.town> Date: Tue, 4 Feb 2020 18:38:26 +0000 Adding post auditing to the template Diffstat:
M | src/format.lisp | | | 12 | ++++++++---- |
M | src/template.eco | | | 12 | ++++++++++++ |
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/src/format.lisp b/src/format.lisp @@ -15,12 +15,16 @@ (lambda (content) (nth 1 (multiple-value-list (markdown content :stream nil))))) -(defun make-short-date-formatter () +(defun make-short-date-formatter (&optional (timezone *default-timezone*)) "Return the default short-date formatter (see +short-date-format+)" (lambda (datetime) - (format-timestring nil datetime :format +short-date-format+))) + (format-timestring nil datetime + :format +short-date-format+ + :timezone timezone))) -(defun make-long-date-formatter () +(defun make-long-date-formatter (&optional (timezone *default-timezone*)) "Return the default long-datetime formatter (see +long-date-format+)" (lambda (datetime) - (format-timestring nil datetime :format +long-date-format+))) + (format-timestring nil datetime + :format +long-date-format+ + :timezone timezone))) diff --git a/src/template.eco b/src/template.eco @@ -19,6 +19,18 @@ <article> <%= (funcall content-formatter content) %> </article> + <p> + <small> + Posted by <%= username %> on + <%= (funcall long-date-formatter created-at) %> + <% if (local-time:timestamp/= created-at updated-at) %> + <br> + Last updated by <%= last-updated-by %> on + <%= (funcall long-date-formatter updated-at) %> + <% else %> + <% end %> + </small> + </p> <% end %> <% end %> <% else %>