fix: links to upcoming episodes page
This commit is contained in:
@@ -1,28 +1,9 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block h2 %}Upcoming Episodes{% endblock %}
|
||||
{% block h2 %}Test Test{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@6.1.19/index.global.min.js'></script>
|
||||
|
||||
<div class="p-4">
|
||||
<twig:Card title="Upcoming episodes of shows your monitoring">
|
||||
<div id="calendar" class="text-white">
|
||||
</div>
|
||||
</twig:Card>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', async function() {
|
||||
let data = await fetch('/api/upcoming-episodes');
|
||||
data = (await data.json())['data'];
|
||||
|
||||
const calendarEl = document.getElementById('calendar');
|
||||
const calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
initialView: 'dayGridMonth',
|
||||
events: data['episodes'],
|
||||
});
|
||||
calendar.render();
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<!-- Well what are you doing here? -->
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user