templates_donate_messagesdir = $(templates_donatedir)/messages
templates_download_DATA = \
- src/templates/download/release.html
+ src/templates/download/release.html \
+ src/templates/download/thank-you.html
templates_downloaddir = $(templatesdir)/download
--- /dev/null
+{% extends "../base.html" %}
+
+{% block title %}{{ _("Thank You For Downloading IPFire") }}{% end block %}
+
+{% block container %}
+ <div class="header">
+ <div class="container">
+ <h1>{{ _("Thank You For Downloading IPFire") }}</h1>
+
+ <p class="text-muted">
+ {{ _("Your download will begin in a few seconds. If not, click the link below.") }}
+ </p>
+
+ <p class="download-path"></p>
+ </div>
+ </div>
+
+ <div class="container">
+ <section>
+ XXX
+ </section>
+ </div>
+{% end block %}
+
+{% block javascript %}
+ <script type="text/javascript">
+ $("p.download-path").ready(function() {
+ const params = new URLSearchParams(window.location.search);
+
+ var file = params.get("file");
+
+ // Avoid downloading files from other websites
+ if (!file.startsWith("https://downloads.ipfire.org/"))
+ return;
+
+ $("p.download-path").prepend($("<a>", {
+ href: encodeURI(file),
+ text: file
+ }));
+
+ setTimeout(function() {
+ window.location = file
+ }, "2000");
+ });
+ </script>
+{% end %}
# Download sites
(r"/downloads", tornado.web.RedirectHandler, { "url" : "/download" }),
(r"/download", download.IndexHandler),
+ (r"/download/thank-you", download.ThankYouHandler),
(r"/download/([0-9a-z\-\.]+)", download.ReleaseHandler),
# Donate
self.redirect("https://www.ipfire.org/download/%s" % release, permanent=True)
+class ThankYouHandler(base.BaseHandler):
+ def get(self):
+ self.render("download/thank-you.html")
+
+
class FileHandler(base.BaseHandler):
def prepare(self):
self.set_header("Pragma", "no-cache")