]> git.ipfire.org Git - ipfire.org.git/commitdiff
downloads: Move from "download" to "downloads"
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Jun 2023 09:40:32 +0000 (09:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Jun 2023 09:40:32 +0000 (09:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/blog/modules/post.html
src/templates/blog/post.html
src/templates/downloads/mirrors.html [moved from src/templates/download/mirrors.html with 100% similarity]
src/templates/downloads/release.html [moved from src/templates/download/release.html with 97% similarity]
src/templates/downloads/thank-you.html [moved from src/templates/download/thank-you.html with 100% similarity]
src/templates/index.html
src/web/__init__.py
src/web/downloads.py [moved from src/web/download.py with 89% similarity]

index 166abdafc0130256b5e0fae4ce0eef215ae87b3a..38a2234fda8de2c3051e742d4000bfaf565b5005 100644 (file)
@@ -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 \
index 8ff9c1ba24344c54cc47f43d5786f620d2ee8bbb..004e7bbb60556a5438ab3d0e4e6773786737f070 100644 (file)
@@ -64,7 +64,7 @@
                {% end %}
 
                {% if post.release %}
-                       <a class="btn btn-primary" href="/download/{{ post.release.slug }}">
+                       <a class="btn btn-primary" href="/downloads/{{ post.release.slug }}">
                                {{ _("Download") }}
                        </a>
                {% end %}
index c1597ae30f5f262b01e5fdf97c7d17754947f5f6..c3b02ade64b8e1d75ad94e14bb16691e6eef4596 100644 (file)
                                                {% end %}
 
                                                {% if post.release %}
-                                                       <a class="button is-dark is-fullwidth" href="/download/{{ post.release.slug }}">
+                                                       <a class="button is-dark is-fullwidth" href="/downloads/{{ post.release.slug }}">
                                                                <span class="icon-text">
                                                                        <span class="icon">
                                                                                <i class="fas fa-download"></i>
similarity index 97%
rename from src/templates/download/release.html
rename to src/templates/downloads/release.html
index 4baa1906da33d116252fa8da052993f162da769f..caf35a666d1c4aad28a9c32f7521f157fea7915c 100644 (file)
                                                <div class="columns">
                                                        <div class="column is-1"></div>
                                                                <div class="column is-10">
-                                                                       <a class="button is-primary is-fullwidth is-medium" href="/download/mirrors">
+                                                                       <a class="button is-primary is-fullwidth is-medium" href="/downloads/mirrors">
                                                                                {{ _("Browse Mirrors") }}
                                                                        </a>
                                                                </div>
                $("a.download-splash").click(function(e) {
                        e.preventDefault();
 
-                       window.location = "/download/thank-you?file=" + this.href;
+                       window.location = "/downloads/thank-you?file=" + this.href;
                });
        </script>
 {% end %}
index f1144317ca3af9332e0d8d54facbcc90deb2ab9e..876c0adc2b07ccd61a536613a8555cbab4ca5f51 100644 (file)
@@ -17,7 +17,7 @@
                                {% if latest_release.blog %}
                                        &nbsp;
 
-                                       <a class="link-dark fw-bold" href="/download/{{ latest_release.slug }}">
+                                       <a class="link-dark fw-bold" href="/downloads/{{ latest_release.slug }}">
                                                {{ _("Get It Now") }}
                                        </a>
                                {% end %}
index 5a238aafc38014f7f924c03e69f39aee22a8b641..7315ce98eae953b95774829f05a38e938380d968 100644 (file)
@@ -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
similarity index 89%
rename from src/web/download.py
rename to src/web/downloads.py
index 3b0203ab4acef03e68628ad0115b0f274d79e41c..00ecafb749ac38a3f9973cdd702e51b9f58fc033 100644 (file)
@@ -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):