From 8ea3eaa25ef913e60aa0b387a774087924143024 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 26 Jun 2023 10:16:31 +0000 Subject: [PATCH 1/1] about: Move the page into the static handler Signed-off-by: Michael Tremer --- Makefile.am | 2 +- src/templates/{ => static}/about.html | 2 +- src/web/__init__.py | 2 +- src/web/handlers.py | 8 -------- 4 files changed, 3 insertions(+), 11 deletions(-) rename src/templates/{ => static}/about.html (99%) diff --git a/Makefile.am b/Makefile.am index 6f898a25..a95a0344 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,7 +103,6 @@ webdir = $(backenddir)/web # TODO install the base for now and add all other templates later templates_DATA = \ - src/templates/about.html \ src/templates/base.html \ src/templates/error.html \ src/templates/index.html @@ -290,6 +289,7 @@ templates_people_modules_DATA = \ templates_people_modulesdir = $(templates_peopledir)/modules templates_static_DATA = \ + src/templates/static/about.html \ src/templates/static/legal.html \ src/templates/static/help.html diff --git a/src/templates/about.html b/src/templates/static/about.html similarity index 99% rename from src/templates/about.html rename to src/templates/static/about.html index 273f818b..0e2fe948 100644 --- a/src/templates/about.html +++ b/src/templates/static/about.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "../base.html" %} {% block title %}{{ _("About IPFire") }}{% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index c1aaf53b..c2b749ab 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -115,7 +115,6 @@ class Application(tornado.web.Application): self.add_handlers(r"(www\.)?([a-z]+\.dev\.)?ipfire\.org", [ # Entry site that lead the user to index (r"/", IndexHandler), - (r"/about", AboutHandler), # Authentication (r"/login", auth.LoginHandler), @@ -175,6 +174,7 @@ class Application(tornado.web.Application): (r"/news/(.*)", handlers.NewsHandler), # Static Pages + (r"/about", StaticHandler, { "template" : "about.html" }), (r"/legal", StaticHandler, { "template" : "legal.html" }), (r"/help", StaticHandler, { "template" : "help.html" }), diff --git a/src/web/handlers.py b/src/web/handlers.py index 8bbfadc5..e79e647c 100644 --- a/src/web/handlers.py +++ b/src/web/handlers.py @@ -26,14 +26,6 @@ class IndexHandler(base.BaseHandler): return self.render("index.html", latest_release=latest_release) -class AboutHandler(base.BaseHandler): - def get(self): - # Cache page for a day - self.set_expires(3600 * 24) - - self.render("about.html") - - class NewsHandler(base.BaseHandler): def get(self, post): self.redirect("https://www.ipfire.org/blog/%s" % post, permanent=True) -- 2.39.2