diff --git a/assets/controllers/monitor_list_controller.js b/assets/controllers/monitor_list_controller.js index 0c9e2ab..0b07a29 100644 --- a/assets/controllers/monitor_list_controller.js +++ b/assets/controllers/monitor_list_controller.js @@ -23,7 +23,12 @@ export default class extends Controller { } if (null !== content && undefined !== content && "" !== content) { - document.dispatchEvent(new CustomEvent('showPreviewContentModal', {detail: {heading: heading, content: content}})) + if (['', null, undefined].includes(monitor.getAttribute('parent-id'))) { + window.location.href = `/monitors/${monitor.getAttribute('monitor-id')}`; + } else { + document.dispatchEvent(new CustomEvent('showPreviewContentModal', {detail: {heading: heading, content: content}})) + } + } }) }) diff --git a/src/Twig/Components/MonitorList.php b/src/Twig/Components/MonitorList.php index 2b80aec..8450618 100644 --- a/src/Twig/Components/MonitorList.php +++ b/src/Twig/Components/MonitorList.php @@ -53,6 +53,7 @@ final class MonitorList extends AbstractController return $this->asPaginator($this->monitorRepository->createQueryBuilder('m') ->andWhere('m.status IN (:statuses)') ->andWhere('(m.title LIKE :term OR m.imdbId LIKE :term OR m.monitorType LIKE :term OR m.status LIKE :term)') + ->andWhere('m.parent IS NULL') ->setParameter('statuses', ['New', 'In Progress', 'Active']) ->setParameter('term', '%'.$this->term.'%') ->orderBy('m.id', 'DESC') diff --git a/templates/components/MonitorList.html.twig b/templates/components/MonitorList.html.twig index 659fcff..0b4ef16 100644 --- a/templates/components/MonitorList.html.twig +++ b/templates/components/MonitorList.html.twig @@ -17,10 +17,17 @@ class="px-6 py-3 text-start"> ID + {% if null != parentMonitorId %} Search Count + {% else %} + + Episodes + + {% endif %} Created at diff --git a/templates/components/MonitorListRow.html.twig b/templates/components/MonitorListRow.html.twig index 8da28e4..79b9694 100644 --- a/templates/components/MonitorListRow.html.twig +++ b/templates/components/MonitorListRow.html.twig @@ -1,5 +1,6 @@ {{ monitor|monitor_media_id }} + {% if null != monitor.parent %} {{ monitor.searchCount }} + {% else %} + + {{ monitor.children|length }} + + {% endif %} {{ monitor.createdAt|date('m/d/Y h:i a') }}