From d25f886f08782da60e63228a50604b355136e352 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 1 Jul 2023 10:59:25 +0000 Subject: [PATCH] docs: Move list module Signed-off-by: Michael Tremer --- Makefile.am | 11 +++-------- src/templates/{wiki => docs}/modules/list.html | 0 src/templates/docs/recent-changes.html | 2 +- src/templates/docs/revisions.html | 2 +- src/templates/docs/search-results.html | 2 +- src/templates/docs/watchlist.html | 2 +- src/web/__init__.py | 5 +---- src/web/docs.py | 8 ++++++++ src/web/wiki.py | 10 ---------- 9 files changed, 16 insertions(+), 26 deletions(-) rename src/templates/{wiki => docs}/modules/list.html (100%) delete mode 100644 src/web/wiki.py diff --git a/Makefile.am b/Makefile.am index 8fd73cab..2aea8a03 100644 --- a/Makefile.am +++ b/Makefile.am @@ -97,8 +97,7 @@ web_PYTHON = \ src/web/people.py \ src/web/ui_modules.py \ src/web/users.py \ - src/web/voip.py \ - src/web/wiki.py + src/web/voip.py webdir = $(backenddir)/web @@ -221,7 +220,8 @@ templates_docs_filesdir = $(templates_docsdir)/files templates_docs_modules_DATA = \ src/templates/docs/modules/diff.html \ - src/templates/docs/modules/header.html + src/templates/docs/modules/header.html \ + src/templates/docs/modules/list.html templates_docs_modulesdir = $(templates_docsdir)/modules @@ -356,11 +356,6 @@ templates_wiki_messages_DATA = \ templates_wiki_messagesdir = $(templates_wikidir)/messages -templates_wiki_modules_DATA = \ - src/templates/wiki/modules/list.html - -templates_wiki_modulesdir = $(templates_wikidir)/modules - # ------------------------------------------------------------------------------ SASS_FILES = \ diff --git a/src/templates/wiki/modules/list.html b/src/templates/docs/modules/list.html similarity index 100% rename from src/templates/wiki/modules/list.html rename to src/templates/docs/modules/list.html diff --git a/src/templates/docs/recent-changes.html b/src/templates/docs/recent-changes.html index 9cb939b1..8b75883f 100644 --- a/src/templates/docs/recent-changes.html +++ b/src/templates/docs/recent-changes.html @@ -15,7 +15,7 @@
- {% module WikiList(recent_changes, show_changes=True) %} + {% module DocsList(recent_changes, show_changes=True) %}
{% end block %} diff --git a/src/templates/docs/revisions.html b/src/templates/docs/revisions.html index 5b80d31c..7f9befc4 100644 --- a/src/templates/docs/revisions.html +++ b/src/templates/docs/revisions.html @@ -7,7 +7,7 @@

{{ _("Revisions of %s") % page.title }}

- {% module WikiList(page.get_revisions(), show_breadcrumbs=False, link_revision=True, show_changes=True) %} + {% module DocsList(page.get_revisions(), show_breadcrumbs=False, link_revision=True, show_changes=True) %}
{% end block %} diff --git a/src/templates/docs/search-results.html b/src/templates/docs/search-results.html index 8689b833..1d45a662 100644 --- a/src/templates/docs/search-results.html +++ b/src/templates/docs/search-results.html @@ -7,7 +7,7 @@
{{ _("Search results for '%s'") % q }}
- {% module WikiList(pages, show_author=False) %} + {% module DocsList(pages, show_author=False) %}
{% end block %} diff --git a/src/templates/docs/watchlist.html b/src/templates/docs/watchlist.html index 2234fecb..4a4aee6d 100644 --- a/src/templates/docs/watchlist.html +++ b/src/templates/docs/watchlist.html @@ -16,7 +16,7 @@
{{ _("Your Watchlist") }}
{% if pages %} - {% module WikiList(pages) %} + {% module DocsList(pages) %} {% else %}
{{ _("You do not have any pages on your watchlist") }} diff --git a/src/web/__init__.py b/src/web/__init__.py index 1bf9e69a..cae5bc01 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -28,7 +28,6 @@ from . import people from . import ui_modules from . import users from . import voip -from . import wiki class Application(tornado.web.Application): def __init__(self, config, **kwargs): @@ -77,6 +76,7 @@ class Application(tornado.web.Application): # Docs "DocsDiff" : docs.DiffModule, "DocsHeader" : docs.HeaderModule, + "DocsList" : docs.ListModule, # Nopaste "Code" : nopaste.CodeModule, @@ -96,9 +96,6 @@ class Application(tornado.web.Application): "VoIPQueues" : voip.QueuesModule, "VoIPRegistrations" : voip.RegistrationsModule, - # Wiki - "WikiList" : wiki.WikiListModule, - # Misc "ChristmasBanner" : ui_modules.ChristmasBannerModule, "Markdown" : ui_modules.MarkdownModule, diff --git a/src/web/docs.py b/src/web/docs.py index 77add707..c4b77ba3 100644 --- a/src/web/docs.py +++ b/src/web/docs.py @@ -375,6 +375,14 @@ class WatchlistHandler(base.BaseHandler): self.render("docs/watchlist.html", pages=pages) +class ListModule(ui_modules.UIModule): + def render(self, pages, link_revision=False, show_breadcrumbs=True, + show_author=True, show_changes=False): + return self.render_string("docs/modules/list.html", link_revision=link_revision, + pages=pages, show_breadcrumbs=show_breadcrumbs, + show_author=show_author, show_changes=show_changes) + + class HeaderModule(ui_modules.UIModule): @property def page(self): diff --git a/src/web/wiki.py b/src/web/wiki.py deleted file mode 100644 index 1eb4a0ce..00000000 --- a/src/web/wiki.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/python3 - -from . import ui_modules - -class WikiListModule(ui_modules.UIModule): - def render(self, pages, link_revision=False, show_breadcrumbs=True, - show_author=True, show_changes=False): - return self.render_string("wiki/modules/list.html", link_revision=link_revision, - pages=pages, show_breadcrumbs=show_breadcrumbs, - show_author=show_author, show_changes=show_changes) -- 2.39.2