diff --git a/AKPlan/locale/de_DE/LC_MESSAGES/django.po b/AKPlan/locale/de_DE/LC_MESSAGES/django.po index 18caa905b6bf2aad2abacfa9200e120ac6e1b867..2c460538bd0f7f440000cc254cf0a99d8ef44e0a 100644 --- a/AKPlan/locale/de_DE/LC_MESSAGES/django.po +++ b/AKPlan/locale/de_DE/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-29 13:36+0000\n" +"POT-Creation-Date: 2022-05-22 08:02+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -63,12 +63,12 @@ msgid "AK Wall" msgstr "AK-Wall" #: AKPlan/templates/AKPlan/plan_index.html:126 -#: AKPlan/templates/AKPlan/plan_wall.html:81 +#: AKPlan/templates/AKPlan/plan_wall.html:116 msgid "Current AKs" msgstr "Aktuelle AKs" #: AKPlan/templates/AKPlan/plan_index.html:133 -#: AKPlan/templates/AKPlan/plan_wall.html:86 +#: AKPlan/templates/AKPlan/plan_wall.html:121 msgid "Next AKs" msgstr "Nächste AKs" @@ -99,6 +99,10 @@ msgstr "Eigenschaften" msgid "Track" msgstr "Track" +#: AKPlan/templates/AKPlan/plan_wall.html:131 +msgid "Reload page automatically?" +msgstr "Seite automatisch neu laden?" + #: AKPlan/templates/AKPlan/slots_table.html:14 msgid "No AKs" msgstr "Keine AKs" diff --git a/AKPlan/templates/AKPlan/plan_wall.html b/AKPlan/templates/AKPlan/plan_wall.html index 2ff5eeaf0eebd09ccdfc60b26277ccfa7fa17af2..c2d474235340ff646fbbfa36aebc89a0a581b0de 100644 --- a/AKPlan/templates/AKPlan/plan_wall.html +++ b/AKPlan/templates/AKPlan/plan_wall.html @@ -65,12 +65,48 @@ plan.render(); // Scroll to current time - if($(".fc-timeline-now-indicator-line").length) { - $('.fc-scroller').scrollLeft($('.fc-timeline-now-indicator-line').position().left); + if($(".fc-timeline-now-indicator-line").length) { + $('.fc-scroller').scrollLeft($('.fc-timeline-now-indicator-line').position().left); + } + + // == Auto Reload == + + // function from: https://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript/ + function findGetParameter(parameterName) { + var result = null, + tmp = []; + location.search + .substr(1) + .split("&") + .forEach(function (item) { + tmp = item.split("="); + if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]); + }); + return result; + } + + // Check whether an autoreload frequency was specified and treat it as full minutes + const autoreload_frequency = Math.ceil(findGetParameter("autoreload")); + const cbxAutoReload = $('#cbxAutoReload'); + + if(autoreload_frequency>0) { + window.setTimeout ( function() { window.location.reload(); }, autoreload_frequency * 60 * 1000); + console.log("Autoreload active"); + cbxAutoReload.prop('checked', true); + } + else { + cbxAutoReload.prop('checked', false); + } + + cbxAutoReload.change(function () { + let url = window.location.href.split('?')[0]; + if(cbxAutoReload.prop('checked')) { + url = url + "?autoreload=5"; } + window.location.replace(url); + }); }); </script> - </head> <body> {% timezone event.timezone %} @@ -92,6 +128,9 @@ <div id="planCalendar"></div> </div> </div> + <div style="position: absolute;bottom: 1vh;left:1vw;background-color: #FFFFFF;padding: 1vh;"> + <input type="checkbox" name="autoreload" id="cbxAutoReload"> <label for="cbxAutoReload">{% trans "Reload page automatically?" %}</label> + </div> {% endtimezone %} </body>