diff --git a/AKPlan/templates/AKPlan/load_fullcalendar.html b/AKPlan/templates/AKPlan/load_fullcalendar.html new file mode 100644 index 0000000000000000000000000000000000000000..30fc76b83ee95d767c23b05e874a5abfd1d61df6 --- /dev/null +++ b/AKPlan/templates/AKPlan/load_fullcalendar.html @@ -0,0 +1,13 @@ +{% load static %} +{% load i18n %} +{% get_current_language as LANGUAGE_CODE %} + +<script src='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.js' %}'></script> +<link href='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.css' %}' rel='stylesheet'/> + +{% with 'AKPlan/vendor/fullcalendar-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %} + {% if LANGUAGE_CODE != "en" %} + {# Locale 'en' is included in main.js and does not exist separately #} + <script src="{% static locale_file %}"></script> + {% endif %} +{% endwith %} diff --git a/AKPlan/templates/AKPlan/plan_akslot.html b/AKPlan/templates/AKPlan/plan_akslot.html index fe86ad273b3b0a070ce5c09531f6eade3b83c921..ffa9dae9a65641c85a797e6a54ade5ce1441b07b 100644 --- a/AKPlan/templates/AKPlan/plan_akslot.html +++ b/AKPlan/templates/AKPlan/plan_akslot.html @@ -1,17 +1,8 @@ {% load static %} {% load tz %} {% load i18n %} -{% get_current_language as LANGUAGE_CODE %} -<script src='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.js' %}'></script> -<link href='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.css' %}' rel='stylesheet'/> - -{% with 'AKPlan/vendor/fullcalendar-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %} - {% if LANGUAGE_CODE != "en" %} - {# Locale 'en' is included in main.js and does not exist separately #} - <script src="{% static locale_file %}"></script> - {% endif %} -{% endwith %} +{% include "AKPlan/load_fullcalendar.html" %} <script> @@ -22,8 +13,6 @@ // Adapt to timezone of the connected event timeZone: '{{ ak.event.timezone }}', initialView: 'timeGrid', - // Adapt to user selected locale - locale: '{{ LANGUAGE_CODE }}', // No header, not buttons headerToolbar: false, aspectRatio: 2.5, diff --git a/AKPlan/templates/AKPlan/plan_base.html b/AKPlan/templates/AKPlan/plan_base.html index 320e3f838652ee7a6aecf115d57024e305eb0470..7234dad49ddafd712f0264870a7015a7a343cdc0 100644 --- a/AKPlan/templates/AKPlan/plan_base.html +++ b/AKPlan/templates/AKPlan/plan_base.html @@ -10,17 +10,7 @@ {% endblock %} {% block imports %} - {% get_current_language as LANGUAGE_CODE %} - - <script src='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.js' %}'></script> - <link href='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.css' %}' rel='stylesheet'/> - - {% with 'AKPlan/vendor/fullcalendar-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %} - {% if LANGUAGE_CODE != "en" %} - {# Locale 'en' is included in main.js and does not exist separately #} - <script src="{% static locale_file %}"></script> - {% endif %} - {% endwith %} + {% include "AKPlan/load_fullcalendar.html" %} {% block fullcalendar %}{% endblock %} {% endblock imports %} diff --git a/AKPlan/templates/AKPlan/plan_wall.html b/AKPlan/templates/AKPlan/plan_wall.html index c824955884bc58b7d8d79d455b95519158a22e5a..ac49b82e3228645552a4636cfcba7a78344520e7 100644 --- a/AKPlan/templates/AKPlan/plan_wall.html +++ b/AKPlan/templates/AKPlan/plan_wall.html @@ -19,17 +19,7 @@ <link rel="stylesheet" href="{% static 'common/css/custom.css' %}"> - {% get_current_language as LANGUAGE_CODE %} - - <script src='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.js' %}'></script> - <link href='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.css' %}' rel='stylesheet'/> - - {% with 'AKPlan/vendor/fullcalendar-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %} - {% if LANGUAGE_CODE != "en" %} - {# Locale 'en' is included in main.js and does not exist separately #} - <script src="{% static locale_file %}"></script> - {% endif %} - {% endwith %} + {% include "AKPlan/load_fullcalendar.html" %} <script> document.addEventListener('DOMContentLoaded', function () { @@ -39,8 +29,6 @@ timeZone: '{{ event.timezone }}', headerToolbar: false, themeSystem: 'bootstrap', - // Adapt to user selected locale - locale: '{{ LANGUAGE_CODE }}', slotDuration: '01:00', initialView: 'resourceTimeline', visibleRange: { diff --git a/AKScheduling/templates/admin/AKScheduling/scheduling.html b/AKScheduling/templates/admin/AKScheduling/scheduling.html index 79480ee6f0e17e9e292a63830039a9502dd5f84b..75dc0c3c23071023c21beb3c5a4d4eed42f453ce 100644 --- a/AKScheduling/templates/admin/AKScheduling/scheduling.html +++ b/AKScheduling/templates/admin/AKScheduling/scheduling.html @@ -11,17 +11,7 @@ {% block extrahead %} {{ block.super }} - {% get_current_language as LANGUAGE_CODE %} - - <script src='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.js' %}'></script> - <link href='{% static 'AKPlan/vendor/fullcalendar-scheduler/main.css' %}' rel='stylesheet'/> - - {% with 'AKPlan/vendor/fullcalendar-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %} - {% if LANGUAGE_CODE != "en" %} - {# Locale 'en' is included in main.js and does not exist separately #} - <script src="{% static locale_file %}"></script> - {% endif %} - {% endwith %} + {% include "AKPlan/load_fullcalendar.html" %} <style> .unscheduled-slot { @@ -88,8 +78,6 @@ }, //aspectRatio: 2, themeSystem: 'bootstrap', - // Adapt to user selected locale - locale: '{{ LANGUAGE_CODE }}', initialView: 'resourceTimelineEventVert', views: { resourceTimelineDayHoriz: {