From: Michael Tremer Date: Mon, 26 Jun 2023 09:40:32 +0000 (+0000) Subject: downloads: Move from "download" to "downloads" X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aec63a26d6db8cc45a09b89069525b2ac73b97eb;p=ipfire.org.git downloads: Move from "download" to "downloads" Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 166abdaf..38a2234f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -85,7 +85,7 @@ web_PYTHON = \ src/web/blog.py \ src/web/boot.py \ src/web/donate.py \ - src/web/download.py \ + src/web/downloads.py \ src/web/fireinfo.py \ src/web/handlers.py \ src/web/iuse.py \ @@ -189,12 +189,12 @@ templates_donate_messages_DATA = \ templates_donate_messagesdir = $(templates_donatedir)/messages -templates_download_DATA = \ - src/templates/download/mirrors.html \ - src/templates/download/release.html \ - src/templates/download/thank-you.html +templates_downloads_DATA = \ + src/templates/downloads/mirrors.html \ + src/templates/downloads/release.html \ + src/templates/downloads/thank-you.html -templates_downloaddir = $(templatesdir)/download +templates_downloadsdir = $(templatesdir)/downloads templates_fireinfo_DATA = \ src/templates/fireinfo/admin.html \ diff --git a/src/templates/blog/modules/post.html b/src/templates/blog/modules/post.html index 8ff9c1ba..004e7bbb 100644 --- a/src/templates/blog/modules/post.html +++ b/src/templates/blog/modules/post.html @@ -64,7 +64,7 @@ {% end %} {% if post.release %} - + {{ _("Download") }} {% end %} diff --git a/src/templates/blog/post.html b/src/templates/blog/post.html index c1597ae3..c3b02ade 100644 --- a/src/templates/blog/post.html +++ b/src/templates/blog/post.html @@ -108,7 +108,7 @@ {% end %} {% if post.release %} - + diff --git a/src/templates/download/mirrors.html b/src/templates/downloads/mirrors.html similarity index 100% rename from src/templates/download/mirrors.html rename to src/templates/downloads/mirrors.html diff --git a/src/templates/download/release.html b/src/templates/downloads/release.html similarity index 97% rename from src/templates/download/release.html rename to src/templates/downloads/release.html index 4baa1906..caf35a66 100644 --- a/src/templates/download/release.html +++ b/src/templates/downloads/release.html @@ -118,7 +118,7 @@
@@ -136,7 +136,7 @@ $("a.download-splash").click(function(e) { e.preventDefault(); - window.location = "/download/thank-you?file=" + this.href; + window.location = "/downloads/thank-you?file=" + this.href; }); {% end %} diff --git a/src/templates/download/thank-you.html b/src/templates/downloads/thank-you.html similarity index 100% rename from src/templates/download/thank-you.html rename to src/templates/downloads/thank-you.html diff --git a/src/templates/index.html b/src/templates/index.html index f1144317..876c0adc 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -17,7 +17,7 @@ {% if latest_release.blog %}   - + {{ _("Get It Now") }} {% end %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 5a238aaf..7315ce98 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -18,7 +18,7 @@ from . import auth from . import blog from . import boot from . import donate -from . import download +from . import downloads from . import fireinfo from . import iuse from . import location @@ -137,12 +137,15 @@ class Application(tornado.web.Application): (r"/blog/([0-9a-z\-\._]+)/edit", blog.EditHandler), (r"/blog/([0-9a-z\-\._]+)/publish", blog.PublishHandler), - # Download sites - (r"/downloads", tornado.web.RedirectHandler, { "url" : "/download" }), - (r"/download", download.IndexHandler), - (r"/download/mirrors", download.MirrorsHandler), - (r"/download/thank-you", download.ThankYouHandler), - (r"/download/([0-9a-z\-\.]+)", download.ReleaseHandler), + # Downloads + (r"/downloads", downloads.IndexHandler), + (r"/downloads/mirrors", downloads.MirrorsHandler), + (r"/downloads/thank-you", downloads.ThankYouHandler), + (r"/downloads/([0-9a-z\-\.]+)", downloads.ReleaseHandler), + + # Download legacy redirection + (r"/download", tornado.web.RedirectHandler, { "url" : "/downloads" }), + (r"/download/([0-9a-z\-\.]+)", tornado.web.RedirectHandler, { "url" : "/downloads/{0}" }), # Donate (r"/donate", donate.DonateHandler), @@ -201,7 +204,7 @@ class Application(tornado.web.Application): self.add_handlers(r"downloads\.([a-z]+\.dev\.)?ipfire\.org", [ (r"/", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/download" }), (r"/release/(.*)", tornado.web.RedirectHandler, { "url" : "https://www.ipfire.org/download/{0}" }), - (r"/(.*)", download.FileHandler), + (r"/(.*)", downloads.FileHandler), ]) # mirrors.ipfire.org diff --git a/src/web/download.py b/src/web/downloads.py similarity index 89% rename from src/web/download.py rename to src/web/downloads.py index 3b0203ab..00ecafb7 100644 --- a/src/web/download.py +++ b/src/web/downloads.py @@ -15,7 +15,7 @@ class IndexHandler(base.BaseHandler): self.set_expires(60) # Redirect to latest release page - self.redirect("/download/%s" % release.slug) + self.redirect("/downloads/%s" % release.slug) class MirrorsHandler(base.BaseHandler): @@ -24,7 +24,7 @@ class MirrorsHandler(base.BaseHandler): if not mirrors: raise tornado.web.HTTPError(404) - self.render("download/mirrors.html", mirrors=mirrors) + self.render("downloads/mirrors.html", mirrors=mirrors) class ReleaseHandler(base.BaseHandler): @@ -36,12 +36,12 @@ class ReleaseHandler(base.BaseHandler): # Cache this response for ten minutes self.set_expires(600) - self.render("download/release.html", release=release) + self.render("downloads/release.html", release=release) class ThankYouHandler(base.BaseHandler): def get(self): - self.render("download/thank-you.html") + self.render("downloads/thank-you.html") class FileHandler(base.BaseHandler):