diff --git a/locale/de_DE/LC_MESSAGES/django.po b/locale/de_DE/LC_MESSAGES/django.po index 821d4c31f3704716f9163d208e8c73e8b7b52c06..9c902594bed0a547e3138d9e7151d32eabb44ecc 100644 --- a/locale/de_DE/LC_MESSAGES/django.po +++ b/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: 2020-05-19 06:38+0000\n" +"POT-Creation-Date: 2020-05-19 21:50+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" @@ -46,10 +46,15 @@ msgstr "Anzahl" msgid "Event Status" msgstr "Event-Status" -#: templates/base.html:78 +#: templates/base.html:28 +msgid "" +"Are you sure you want to change the language now? This will clear the form!" +msgstr "Wirklich jetzt die Sprache ändern? Das wird das Formular zurücksetzen!" + +#: templates/base.html:97 msgid "Impress" msgstr "Impressum" -#: templates/base.html:81 +#: templates/base.html:100 msgid "This software is open source" msgstr "Diese Software ist Open Source" diff --git a/templates/base.html b/templates/base.html index 2b24b9460d1c0a36d716de33d6545f6739491552..7971ddbfe96b0964f12486e229421614bc242f4c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -19,6 +19,26 @@ <link rel="stylesheet" href="{% static 'common/css/custom.css' %}"> + <script type='text/javascript'> + var changed_form = false; + + $(document).ready(function() { + // Ask before changing language if user changed main form on page + $("#language-switcher").submit(function(e){ + if(changed_form) { + if(!confirm("{% trans 'Are you sure you want to change the language now? This will clear the form!' %}")) + e.preventDefault(e); + } + }); + + // Remember any main form edits/changes + $("form.post-form :input").change(function(){ + if($(this).val() != '') + changed_form = true; + }); + }); + </script> + {% block imports %}{% endblock %} </head> <body> @@ -29,6 +49,7 @@ method="post" class="form-inline" name="language-form" + id="language-switcher" style="flex-direction: column;"> {% csrf_token %}