]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Show when a page was last edited and by whom
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 12 Nov 2018 15:52:23 +0000 (15:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 12 Nov 2018 15:52:23 +0000 (15:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/wiki.py
src/templates/wiki/page.html

index 42507e97066d6baa82f1005f4ff90421d5cec655..9dabb55c13a8c4b01d419dcb1d153226e0879945 100644 (file)
@@ -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)
 
index 13f08e645fb736af4e82840a242b7a259b7cb833..f5cd8cff3157843a1ab39c03807dd9b029824e8b 100644 (file)
@@ -15,7 +15,7 @@
 {% block main %}
        {% module WikiNavbar(page) %}
 
-       <div class="card">
+       <div class="card mb-3">
                <div class="card-body">
                        <div class="user-content">
                                <div class="user-content-body">
                        </div>
                </div>
        </div>
+
+       <p class="small text-right">
+               {{ _("Last modified %s") % locale.format_date(page.timestamp) }}
+
+               {% if page.author %}
+                       &bull;
+
+                       <a href="/users/{{ page.author.uid }}">
+                               {{ page.author }}
+                       </a>
+               {% end %}
+       </p>
 {% end block %}