]> git.ipfire.org Git - ipfire.org.git/commitdiff
download: Add dynamic redirect to thank you page
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 18 Nov 2020 21:52:22 +0000 (21:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 18 Nov 2020 21:52:22 +0000 (21:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/download/release.html

index 98c7384fe978a929b046795a64f02914de84da76..6917fa5fa6ae6b37e8f702997f903caa9ef84522 100644 (file)
@@ -39,7 +39,7 @@
                                        </div>
 
                                        {% for file in release.get_files_by_arch(arch) %}
-                                               <a class="list-group-item list-group-item-action" href="{{ file.url }}">
+                                               <a class="list-group-item list-group-item-action download-splash" href="{{ file.url }}">
                                                        <h6>
                                                                {{ _(file.desc) }} <i class="fas fa-download text-primary"></i>
                                                        </h6>
                </div>
        </section>
 {% end block %}
+
+{% block javascript %}
+       <script type="text/javascript">
+               $("a.download-splash").click(function(e) {
+                       e.preventDefault();
+
+                       window.location = "/download/thank-you?file=" + this.href;
+               });
+       </script>
+{% end %}