wip: renders calendar with demo data
This commit is contained in:
68
templates/index/test.html.twig
Normal file
68
templates/index/test.html.twig
Normal file
@@ -0,0 +1,68 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% 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>
|
||||
<div class="p-4">
|
||||
<twig:Card title="List of upcoming episodes">
|
||||
<div id="calendar" class="text-white">
|
||||
</div>
|
||||
</twig:Card>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user