]> git.ipfire.org Git - ipfire.org.git/commitdiff
static: Make file name handling sane
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Dec 2023 15:25:03 +0000 (15:25 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Dec 2023 15:25:03 +0000 (15:25 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/__init__.py
src/web/handlers.py

index 0531f33e82253b38c378918521177fef7af4052b..da7c90920d2d707e165d4a099ae664572e3f5f7b 100644 (file)
@@ -153,7 +153,7 @@ class Application(tornado.web.Application):
 
                        # Downloads
                        (r"/downloads", downloads.IndexHandler),
-                       (r"/downloads/cloud", StaticHandler, { "template" : "../downloads/cloud.html" }),
+                       (r"/downloads/cloud", StaticHandler, { "template" : "downloads/cloud.html" }),
                        (r"/downloads/mirrors", downloads.MirrorsHandler),
                        (r"/downloads/thank-you", downloads.ThankYouHandler),
                        (r"/downloads/([0-9a-z\-\.]+)", downloads.ReleaseHandler),
@@ -172,8 +172,8 @@ class Application(tornado.web.Application):
 
                        # Projects
                        (r"/projects/location", location.IndexHandler),
-                       (r"/projects/location/download", StaticHandler, { "template" : "../location/download.html" }),
-                       (r"/projects/location/how\-to\-use", StaticHandler, { "template" : "../location/how-to-use.html" }),
+                       (r"/projects/location/download", StaticHandler, { "template" : "location/download.html" }),
+                       (r"/projects/location/how\-to\-use", StaticHandler, { "template" : "location/how-to-use.html" }),
                        (r"/projects/location/lookup/(.+)", location.LookupHandler),
 
                        # Single-Sign-On for Discourse
@@ -199,10 +199,10 @@ class Application(tornado.web.Application):
                        (r"/voip", voip.IndexHandler),
 
                        # Static Pages
-                       (r"/about",  StaticHandler, { "template" : "about.html" }),
-                       (r"/legal", StaticHandler, { "template" : "legal.html" }),
-                       (r"/help", StaticHandler, { "template" : "help.html" }),
-                       (r"/sitemap",  StaticHandler, { "template" : "sitemap.html" }),
+                       (r"/about",  StaticHandler, { "template" : "static/about.html" }),
+                       (r"/legal", StaticHandler, { "template" : "static/legal.html" }),
+                       (r"/help", StaticHandler, { "template" : "static/help.html" }),
+                       (r"/sitemap",  StaticHandler, { "template" : "static/sitemap.html" }),
 
                        # API
                        (r"/api/check/email", auth.APICheckEmail),
index 1285a5c6cbb7f1a4e0feaa145c4909d87db46684..739c4b62b2e5d1c04fae37bd561c088b8cc453a2 100644 (file)
@@ -18,4 +18,4 @@ class StaticHandler(base.BaseHandler):
                self._template = template
 
        def get(self):
-               self.render("static/%s" % self._template)
+               self.render("%s" % self._template)