Skip to content
Snippets Groups Projects
Commit 5e17b663 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Add fullcalendar v5 (without scheduler) and use for availabilities

Add new library files to common
Add new template to load all css and scripts with one call
Use that loader in views with availabilities editors
parent 0754f163
No related branches found
No related tags found
No related merge requests found
{% load static %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
<link href='{% static 'common/vendor/fullcalendar/main.css' %}' rel='stylesheet'/>
<script src='{% static 'common/vendor/fullcalendar/main.js' %}'></script>
<script src="{% static "common/vendor/moment/moment-with-locales.js" %}"></script>
<script src="{% static "common/js/availabilities.js" %}"></script>
{% with 'common/vendor/fullcalendar/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 %}
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
{% block extrahead %} {% block extrahead %}
{{ block.super }} {{ block.super }}
{% bootstrap_javascript jquery='slim' %} {% bootstrap_javascript jquery='slim' %}
{% include "AKPlan/load_fullcalendar.html" %} {% include "AKModel/load_fullcalendar_availabilities.html" %}
<script src="{% static "common/js/availabilities.js" %}"></script>
<script> <script>
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
......
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
<link rel="stylesheet" href="{% static 'common/vendor/chosen-js/chosen.css' %}"> <link rel="stylesheet" href="{% static 'common/vendor/chosen-js/chosen.css' %}">
<link rel="stylesheet" href="{% static 'common/css/bootstrap-chosen.css' %}"> <link rel="stylesheet" href="{% static 'common/css/bootstrap-chosen.css' %}">
{% include "AKPlan/load_fullcalendar.html" %} {% include "AKModel/load_fullcalendar_availabilities.html" %}
<script src="{% static "AKSubmission/vendor/moment/moment-with-locales.js" %}"></script>
<script src="{% static "common/js/availabilities.js" %}"></script>
<script> <script>
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
......
FullCalendar.globalLocales.push(function () {
'use strict';
function affix(buttonText) {
return buttonText === "Tag" || buttonText === "Monat" ? "r" : buttonText === "Jahr" ? "s" : "";
}
var de = {
code: "de",
week: {
dow: 1,
doy: 4
},
buttonText: {
prev: "Zur\xFCck",
next: "Vor",
today: "Heute",
year: "Jahr",
month: "Monat",
week: "Woche",
day: "Tag",
list: "Termin\xFCbersicht"
},
weekText: "KW",
weekTextLong: "Woche",
allDayText: "Ganzt\xE4gig",
moreLinkText: function(n) {
return "+ weitere " + n;
},
noEventsText: "Keine Ereignisse anzuzeigen",
buttonHints: {
prev: function(buttonText) {
return "Vorherige".concat(affix(buttonText), " ").concat(buttonText);
},
next: function(buttonText) {
return "N\xE4chste".concat(affix(buttonText), " ").concat(buttonText);
},
today: function(buttonText) {
if (buttonText === "Tag") {
return "Heute";
}
return "Diese".concat(affix(buttonText), " ").concat(buttonText);
}
},
viewHint: function(buttonText) {
var glue = buttonText === "Woche" ? "n" : buttonText === "Monat" ? "s" : "es";
return buttonText + glue + "ansicht";
},
navLinkHint: "Gehe zu $0",
moreLinkHint: function(eventCnt) {
return "Zeige " + (eventCnt === 1 ? "ein weiteres Ereignis" : eventCnt + " weitere Ereignisse");
},
closeHint: "Schlie\xDFen",
timeHint: "Uhrzeit",
eventHint: "Ereignis"
};
return de;
}());
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment