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

Fix fullcalendar theming issues

Add bootstrap plugin (not included in fc by default anymore)
Activate compression
Make sure font awesome icons are used instead of loading bootstrap icons fc defaults to only for two buttons in fc
Remove copy-paste-error text in scheduler
parent c189d4e2
No related branches found
No related tags found
1 merge request!158Upgrades (bootstrap, fontawesome, django, js dependencies) and static file compression
{% load compress %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<script src='{% static 'common/vendor/fullcalendar-scheduler/fullcalendar-6.0.2.js' %}'></script> {% compress js %}
<script src='{% static 'common/vendor/fullcalendar-scheduler/fullcalendar-6.0.2.js' %}'></script>
<script src='{% static 'common/vendor/fullcalendar-scheduler/fullcalendar.bootstrap5-5.0.2.min.js' %}'></script>
{% with 'common/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 %}
{% endcompress %}
{% with 'common/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 %}
{% load compress %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %} {% get_current_language as LANGUAGE_CODE %}
<script src='{% static 'common/vendor/fullcalendar-scheduler/fullcalendar-6.0.2.js' %}'></script> {% compress js %}
<script src="{% static "common/vendor/moment/moment-with-locales.js" %}"></script> <script src='{% static 'common/vendor/fullcalendar-scheduler/fullcalendar-6.0.2.js' %}'></script>
<script src="{% static "common/js/availabilities.js" %}"></script> <script src='{% static 'common/vendor/fullcalendar-scheduler/fullcalendar.bootstrap5-5.0.2.min.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-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %} {% with 'common/vendor/fullcalendar-scheduler/locales/'|add:LANGUAGE_CODE|add:'.js' as locale_file %}
{% if LANGUAGE_CODE != "en" %} {% if LANGUAGE_CODE != "en" %}
{# Locale 'en' is included in main.js and does not exist separately #} {# Locale 'en' is included in main.js and does not exist separately #}
<script src="{% static locale_file %}"></script> <script src="{% static locale_file %}"></script>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
{% endcompress %}
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
headerToolbar: false, headerToolbar: false,
aspectRatio: 2.5, aspectRatio: 2.5,
themeSystem: 'bootstrap5', themeSystem: 'bootstrap5',
buttonIcons: {
prev: 'ignore fa-solid fa-angle-left',
next: 'ignore fa-solid fa-angle-right',
},
// Only show calendar view for the dates of the connected event // Only show calendar view for the dates of the connected event
visibleRange: { visibleRange: {
start: '{{ ak.event.start | timezone:ak.event.timezone | date:"Y-m-d H:i:s" }}', start: '{{ ak.event.start | timezone:ak.event.timezone | date:"Y-m-d H:i:s" }}',
......
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
}, },
aspectRatio: 2, aspectRatio: 2,
themeSystem: 'bootstrap5', themeSystem: 'bootstrap5',
buttonIcons: {
prev: 'ignore fa-solid fa-angle-left',
next: 'ignore fa-solid fa-angle-right',
},
// Only show calendar view for the dates of the connected event // Only show calendar view for the dates of the connected event
visibleRange: { visibleRange: {
start: '{{ event.start | timezone:event.timezone | date:"Y-m-d H:i:s" }}', start: '{{ event.start | timezone:event.timezone | date:"Y-m-d H:i:s" }}',
......
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
right: 'resourceTimelineDay,resourceTimelineEvent' right: 'resourceTimelineDay,resourceTimelineEvent'
}, },
themeSystem: 'bootstrap5', themeSystem: 'bootstrap5',
buttonIcons: {
prev: 'ignore fa-solid fa-angle-left',
next: 'ignore fa-solid fa-angle-right',
},
// Adapt to user selected locale // Adapt to user selected locale
locale: '{{ LANGUAGE_CODE }}', locale: '{{ LANGUAGE_CODE }}',
initialView: 'resourceTimelineEvent', initialView: 'resourceTimelineEvent',
......
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
timeZone: '{{ event.timezone }}', timeZone: '{{ event.timezone }}',
headerToolbar: false, headerToolbar: false,
themeSystem: 'bootstrap5', themeSystem: 'bootstrap5',
buttonIcons: {
prev: 'ignore fa-solid fa-angle-left',
next: 'ignore fa-solid fa-angle-right',
},
// Adapt to user selected locale // Adapt to user selected locale
locale: '{{ LANGUAGE_CODE }}', locale: '{{ LANGUAGE_CODE }}',
slotDuration: '01:00', slotDuration: '01:00',
......
...@@ -84,6 +84,10 @@ ...@@ -84,6 +84,10 @@
//aspectRatio: 2, //aspectRatio: 2,
height: '100%', height: '100%',
themeSystem: 'bootstrap5', themeSystem: 'bootstrap5',
buttonIcons: {
prev: 'ignore fa-solid fa-angle-left',
next: 'ignore fa-solid fa-angle-right',
},
// Adapt to user selected locale // Adapt to user selected locale
locale: '{{ LANGUAGE_CODE }}', locale: '{{ LANGUAGE_CODE }}',
initialView: 'resourceTimelineEventVert', initialView: 'resourceTimelineEventVert',
...@@ -288,7 +292,6 @@ ...@@ -288,7 +292,6 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">{% trans "Add slot" %}</h5> <h5 class="modal-title">{% trans "Add slot" %}</h5>
text-decoration: none;
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form> <form>
......
...@@ -53,6 +53,10 @@ function createAvailabilityEditors(timezone, language, startDate, endDate, slotR ...@@ -53,6 +53,10 @@ function createAvailabilityEditors(timezone, language, startDate, endDate, slotR
let plan = new FullCalendar.Calendar(editor[0], { let plan = new FullCalendar.Calendar(editor[0], {
timeZone: timezone, timeZone: timezone,
themeSystem: 'bootstrap5', themeSystem: 'bootstrap5',
buttonIcons: {
prev: 'ignore fa-solid fa-angle-left',
next: 'ignore fa-solid fa-angle-right',
},
locale: language, locale: language,
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source', schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
editable: editable, editable: editable,
......
/*!
FullCalendar Bootstrap 5 Plugin v6.0.2
Docs & License: https://fullcalendar.io/docs/bootstrap5
(c) 2022 Adam Shaw
*/
FullCalendar.Bootstrap5=function(e,t,o){"use strict";class r extends o.Theme{}r.prototype.classes={root:"fc-theme-bootstrap5",tableCellShaded:"fc-theme-bootstrap5-shaded",buttonGroup:"btn-group",button:"btn btn-primary",buttonActive:"active",popover:"popover",popoverHeader:"popover-header",popoverContent:"popover-body"},r.prototype.baseIconClass="bi",r.prototype.iconClasses={close:"bi-x-lg",prev:"bi-chevron-left",next:"bi-chevron-right",prevYear:"bi-chevron-double-left",nextYear:"bi-chevron-double-right"},r.prototype.rtlIconClasses={prev:"bi-chevron-right",next:"bi-chevron-left",prevYear:"bi-chevron-double-right",nextYear:"bi-chevron-double-left"},r.prototype.iconOverrideOption="buttonIcons",r.prototype.iconOverrideCustomButtonOption="icon",r.prototype.iconOverridePrefix="bi-";o.injectStyles(".fc-theme-bootstrap5 a:not([href]){color:inherit;text-decoration:inherit}.fc-theme-bootstrap5 .fc-list,.fc-theme-bootstrap5 .fc-scrollgrid,.fc-theme-bootstrap5 td,.fc-theme-bootstrap5 th{border:1px solid var(--bs-gray-400)}.fc-theme-bootstrap5 .fc-scrollgrid{border-bottom-width:0;border-right-width:0}.fc-theme-bootstrap5-shaded{background-color:var(--bs-gray-200)}");var a=t.createPlugin({name:"@fullcalendar/bootstrap5",themeClasses:{bootstrap5:r}}),n={__proto__:null,BootstrapTheme:r};return t.globalPlugins.push(a),e.Internal=n,e.default=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment