From 86368c12976cf5010241eb6b7f9752725c712e24 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 19 May 2020 16:17:34 +0000 Subject: [PATCH] wiki: Add tree This lists all pages on the wiki Signed-off-by: Michael Tremer --- Makefile.am | 1 + src/backend/wiki.py | 8 ++++++++ src/scss/_variables.scss | 2 +- src/templates/base.html | 6 +++++- src/templates/wiki/tree.html | 38 ++++++++++++++++++++++++++++++++++++ src/web/__init__.py | 1 + src/web/wiki.py | 5 +++++ 7 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 src/templates/wiki/tree.html diff --git a/Makefile.am b/Makefile.am index c88e0cfe..63c51e1f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -323,6 +323,7 @@ templates_wiki_DATA = \ src/templates/wiki/recent-changes.html \ src/templates/wiki/revisions.html \ src/templates/wiki/search-results.html \ + src/templates/wiki/tree.html \ src/templates/wiki/watchlist.html templates_wikidir = $(templatesdir)/wiki diff --git a/src/backend/wiki.py b/src/backend/wiki.py index 2fb898d7..d2212ec9 100644 --- a/src/backend/wiki.py +++ b/src/backend/wiki.py @@ -23,6 +23,14 @@ class Wiki(misc.Object): if res: return Page(self.backend, res.id, data=res) + def __iter__(self): + return self._get_pages( + "SELECT wiki.* FROM wiki_current current \ + LEFT JOIN wiki ON current.id = wiki.id \ + WHERE current.deleted IS FALSE \ + ORDER BY page", + ) + def make_path(self, page, path): # Nothing to do for absolute links if path.startswith("/"): diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index 2b781ed3..772a14d5 100644 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -46,7 +46,7 @@ $font-weight-bold: 700; // Typo $font-size-base: 1.125rem; $lead-font-size: 1.5rem; -$small-font-size: 87.5%; +$small-font-size: 85%; $line-height-base: 1.5; diff --git a/src/templates/base.html b/src/templates/base.html index 3c3ca4d1..bee5bb0d 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -353,12 +353,16 @@