fix: removes fullcalendar from importmap and references from cdn
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
{% block javascripts %}
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@6.1.19/index.global.min.js'></script>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body class="flex flex-col bg-stone-700">
|
||||
|
||||
@@ -2,67 +2,23 @@
|
||||
|
||||
{% block h2 %}Upcoming Episodes{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script type='importmap'>
|
||||
{
|
||||
"imports": {
|
||||
"@fullcalendar/core": "https://cdn.skypack.dev/@fullcalendar/core@6.1.19",
|
||||
"@fullcalendar/daygrid": "https://cdn.skypack.dev/@fullcalendar/daygrid@6.1.19"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type='module'>
|
||||
import { Calendar } from '@fullcalendar/core'
|
||||
import dayGridPlugin from '@fullcalendar/daygrid'
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const calendarEl = document.getElementById('calendar')
|
||||
const calendar = new Calendar(calendarEl, {
|
||||
plugins: [dayGridPlugin],
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
|
||||
},
|
||||
events: [
|
||||
{
|
||||
'id': 1,
|
||||
'title': 'South Park (S26E01)',
|
||||
'start': '2025-07-23'
|
||||
},
|
||||
{
|
||||
'id': 2,
|
||||
'title': 'South Park (S26E02)',
|
||||
'start': '2025-08-06'
|
||||
},
|
||||
{
|
||||
'id': 3,
|
||||
'title': 'South Park (S26E03)',
|
||||
'start': '2025-08-20'
|
||||
},
|
||||
{
|
||||
'id': 4,
|
||||
'title': 'South Park (S26E04)',
|
||||
'start': '2025-09-03'
|
||||
}
|
||||
]
|
||||
})
|
||||
calendar.render()
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
:root {
|
||||
--fc-border-color: orange;
|
||||
}
|
||||
</style>
|
||||
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@6.1.19/index.global.min.js'></script>
|
||||
|
||||
<div class="p-4">
|
||||
<twig:Card title="List of upcoming episodes">
|
||||
<twig:Card title="Upcoming episodes of shows your monitoring">
|
||||
<div id="calendar" class="text-white">
|
||||
</div>
|
||||
</twig:Card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
initialView: 'dayGridMonth'
|
||||
});
|
||||
calendar.render();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user