From 3b05ef6e891c9664e0facd1b7bafae1899b14043 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 12 Nov 2018 15:52:23 +0000 Subject: [PATCH] wiki: Show when a page was last edited and by whom Signed-off-by: Michael Tremer --- src/backend/wiki.py | 5 +++++ src/templates/wiki/page.html | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/backend/wiki.py b/src/backend/wiki.py index 42507e97..9dabb55c 100644 --- a/src/backend/wiki.py +++ b/src/backend/wiki.py @@ -138,6 +138,11 @@ class Page(misc.Object): if m: return m.group(1) + @lazy_property + def author(self): + if self.data.author_uid: + return self.backend.accounts.get_by_uid(self.data.author_uid) + def _render(self, text): logging.debug("Rendering %s" % self) diff --git a/src/templates/wiki/page.html b/src/templates/wiki/page.html index 13f08e64..f5cd8cff 100644 --- a/src/templates/wiki/page.html +++ b/src/templates/wiki/page.html @@ -15,7 +15,7 @@ {% block main %} {% module WikiNavbar(page) %} -
+
@@ -24,4 +24,16 @@
+ +

+ {{ _("Last modified %s") % locale.format_date(page.timestamp) }} + + {% if page.author %} + • + + + {{ page.author }} + + {% end %} +

{% end block %} -- 2.47.3