|
17 | 17 |
|
18 | 18 | <link rel="stylesheet" href="{% static 'css/main.css' %}"> |
19 | 19 |
|
| 20 | + <script type='text/javascript'> |
| 21 | + var changed_form = false; |
| 22 | + |
| 23 | + $(document).ready(function() { |
| 24 | + // Ask before changing language if user changed main form on page |
| 25 | + $("#language-switcher").submit(function(e){ |
| 26 | + if(changed_form) { |
| 27 | + if(!confirm("{% trans 'Are you sure you want to change the language now? This will clear the form!' %}")) |
| 28 | + e.preventDefault(e); |
| 29 | + } |
| 30 | + }); |
| 31 | + |
| 32 | + // Remember any main form edits/changes |
| 33 | + $("form.post-form :input").change(function(){ |
| 34 | + if($(this).val() != '') |
| 35 | + changed_form = true; |
| 36 | + }); |
| 37 | + }); |
| 38 | + </script> |
| 39 | + |
20 | 40 | {% block imports %}{% endblock %} |
21 | 41 | </head> |
22 | 42 | <body> |
23 | 43 |
|
24 | | -{% block general_content %} |
| 44 | + {% block general_content %} |
| 45 | + {% endblock %} |
25 | 46 |
|
26 | | -{% endblock %} |
| 47 | + <div class="container" style="padding-top:1em;padding-bottom: 1em;"> |
| 48 | + {% block footer_custom %} |
| 49 | + {% endblock %} |
| 50 | + {% footer_info as FI %} |
| 51 | + {% if FI.impress_text %} |
| 52 | + {{ FI.impress_text }} · |
| 53 | + {% endif %} |
| 54 | + {% if FI.impress_url %} |
| 55 | + <a href="{{ FI.impress_url }}">{% trans "Impress" %}</a> · |
| 56 | + {% endif %} |
| 57 | + {% if FI.repo_url %} |
| 58 | + <a href="{{ FI.repo_url }}">{% trans "This software is open source" %}</a> |
| 59 | + {% endif %} |
| 60 | + </div> |
27 | 61 |
|
28 | | -<div class="container" style="padding-top:1em;padding-bottom: 1em;"> |
29 | | - {% block footer_custom %} |
30 | | - {% endblock %} |
31 | | - {% footer_info as FI %} |
32 | | - {% if FI.impress_text %} |
33 | | - {{ FI.impress_text }} · |
34 | | - {% endif %} |
35 | | - {% if FI.impress_url %} |
36 | | - <a href="{{ FI.impress_url }}">{% trans "Impress" %}</a> · |
37 | | - {% endif %} |
38 | | - {% if FI.repo_url %} |
39 | | - <a href="{{ FI.repo_url }}">{% trans "This software is open source" %}</a> |
40 | | - {% endif %} |
41 | | -</div> |
42 | | - |
43 | | -{% block bottom_script %}{% endblock %} |
| 62 | + {% block bottom_script %}{% endblock %} |
44 | 63 |
|
45 | 64 | </body> |
46 | 65 | </html> |
0 commit comments