From: Michael Tremer Date: Mon, 12 Nov 2018 15:52:23 +0000 (+0000) Subject: wiki: Show when a page was last edited and by whom X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b05ef6e891c9664e0facd1b7bafae1899b14043;p=ipfire.org.git wiki: Show when a page was last edited and by whom Signed-off-by: Michael Tremer --- 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 %}