diff --git a/assets/controllers/upcoming_episodes_controller.js b/assets/controllers/upcoming_episodes_controller.js new file mode 100644 index 0000000..fd4ff3d --- /dev/null +++ b/assets/controllers/upcoming_episodes_controller.js @@ -0,0 +1,38 @@ +import { Controller } from '@hotwired/stimulus'; +import { Calendar } from '@fullcalendar/core'; +import dayGridPlugin from '@fullcalendar/daygrid'; +import timeGridPlugin from '@fullcalendar/timegrid'; +import listPlugin from '@fullcalendar/list'; + +/* stimulusFetch: 'lazy' */ +export default class extends Controller { + + initialize() { + + } + + connect() { + let calendar = new Calendar(this.element, { + plugins: [ dayGridPlugin, timeGridPlugin, listPlugin ], + initialView: 'dayGridMonth', + headerToolbar: { + left: 'prev,next today', + center: 'title', + right: 'dayGridMonth,timeGridWeek,listWeek' + } + }); + calendar.render(); + // calendar.render(); + } + + // Add custom controller actions here + // fooBar() { this.fooTarget.classList.toggle(this.bazClass) } + + disconnect() { + // Called anytime its element is disconnected from the DOM + // (on page change, when it's removed from or moved in the DOM, etc.) + + // Here you should remove all event listeners added in "connect()" + // this.fooTarget.removeEventListener('click', this._fooBar) + } +} diff --git a/importmap.php b/importmap.php index 83ec592..e91dd78 100644 --- a/importmap.php +++ b/importmap.php @@ -70,4 +70,37 @@ return [ '@ungap/custom-elements' => [ 'version' => '1.3.0', ], +// '@fullcalendar/core' => [ +// 'version' => '6.1.19', +// ], +// '@fullcalendar/daygrid' => [ +// 'version' => '6.1.19', +// ], +// '@fullcalendar/timegrid' => [ +// 'version' => '6.1.19', +// ], +// '@fullcalendar/list' => [ +// 'version' => '6.1.19', +// ], +// 'preact' => [ +// 'version' => '10.12.1', +// ], +// 'preact/compat' => [ +// 'version' => '10.12.1', +// ], +// '@fullcalendar/core/index.js' => [ +// 'version' => '6.1.19', +// ], +// '@fullcalendar/core/internal.js' => [ +// 'version' => '6.1.19', +// ], +// '@fullcalendar/core/preact.js' => [ +// 'version' => '6.1.19', +// ], +// '@fullcalendar/daygrid/internal.js' => [ +// 'version' => '6.1.19', +// ], +// 'preact/hooks' => [ +// 'version' => '10.12.1', +// ], ]; diff --git a/src/Base/Framework/Controller/IndexController.php b/src/Base/Framework/Controller/IndexController.php index 1fe8fcf..b5abf67 100644 --- a/src/Base/Framework/Controller/IndexController.php +++ b/src/Base/Framework/Controller/IndexController.php @@ -53,9 +53,6 @@ final class IndexController extends AbstractController #[Route('/test')] public function monitorTvShow(): Response { - $this->monitorTvShowHandler->handle(new MonitorTvShowCommand(96)); - return $this->json([ - 'Success' => 'Monitor added' - ]); + return $this->render('index/test.html.twig', []); } } diff --git a/templates/index/test.html.twig b/templates/index/test.html.twig new file mode 100644 index 0000000..05d57b8 --- /dev/null +++ b/templates/index/test.html.twig @@ -0,0 +1,68 @@ +{% extends 'base.html.twig' %} + +{% block h2 %}Upcoming Episodes{% endblock %} + +{% block javascripts %} + + + +{% endblock %} + +{% block body %} + +
+ +
+
+
+
+{% endblock %} \ No newline at end of file