From: Michael Tremer Date: Mon, 12 Nov 2018 17:22:26 +0000 (+0000) Subject: wiki: Show recent changes X-Git-Url: http://git.ipfire.org/?p=ipfire.org.git;a=commitdiff_plain;h=f9db574a6006d2c7160e2156715b6c5a64f4d1ab wiki: Show recent changes Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 6bbd6078..08ef93a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -255,11 +255,13 @@ templates_staticdir = $(templatesdir)/static templates_wiki_DATA = \ src/templates/wiki/base.html \ - src/templates/wiki/page.html + src/templates/wiki/page.html \ + src/templates/wiki/recent-changes.html templates_wikidir = $(templatesdir)/wiki templates_wiki_modules_DATA = \ + src/templates/wiki/modules/list.html \ src/templates/wiki/modules/navbar.html templates_wiki_modulesdir = $(templates_wikidir)/modules diff --git a/src/backend/wiki.py b/src/backend/wiki.py index 9dabb55c..26d96b4e 100644 --- a/src/backend/wiki.py +++ b/src/backend/wiki.py @@ -48,9 +48,10 @@ class Wiki(misc.Object): if res: return Page(self.backend, res.id, data=res) - def get_recent_changes(self): + def get_recent_changes(self, limit=None): return self._get_pages("SELECT * FROM wiki \ - WHERE timestamp >= NOW() - INTERVAL '4 weeks' ORDER BY timestamp DESC") + WHERE timestamp >= NOW() - INTERVAL '4 weeks' \ + ORDER BY timestamp DESC LIMIT %s", limit) def create_page(self, page, author, markdown): page = Page.sanitise_page_name(page) diff --git a/src/templates/base.html b/src/templates/base.html index 858dca2b..7a7c314b 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -197,7 +197,15 @@