feat: shows monitor poster on modal
This commit is contained in:
@@ -28,6 +28,9 @@ export default class PreviewContentDialog extends HTMLDialogElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
display({ heading, content }) {
|
display({ heading, content }) {
|
||||||
|
if (this.hasAttribute('mdWidth')) {
|
||||||
|
this.style.width = this.getAttribute('mdWidth');
|
||||||
|
}
|
||||||
this.setHeading(heading);
|
this.setHeading(heading);
|
||||||
this.setContent(content);
|
this.setContent(content);
|
||||||
this.showModal();
|
this.showModal();
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class ApiController extends AbstractController
|
|||||||
'allDay' => true,
|
'allDay' => true,
|
||||||
'backgroundColor' => $eventColors[$monitor->getImdbId()],
|
'backgroundColor' => $eventColors[$monitor->getImdbId()],
|
||||||
'borderColor' => $eventColors[$monitor->getImdbId()],
|
'borderColor' => $eventColors[$monitor->getImdbId()],
|
||||||
|
'attachment' => $monitor->getPoster(),
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,11 +28,13 @@
|
|||||||
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
<td class="px-6 py-4 whitespace-nowrap text-sm">
|
||||||
{{ monitor|monitor_media_id }}
|
{{ monitor|monitor_media_id }}
|
||||||
</td>
|
</td>
|
||||||
|
{# Monitor is a CHILD monitor #}
|
||||||
{% if null != monitor.parent %}
|
{% if null != monitor.parent %}
|
||||||
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
||||||
{{ monitor.searchCount }}
|
{{ monitor.searchCount }}
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
{# Monitor is a PARENT monitor #}
|
||||||
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
<td class="hidden md:table-cell px-6 py-4 whitespace-nowrap text-sm">
|
||||||
{{ monitor.children|length }}
|
{{ monitor.children|length }}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<dialog{{ attributes }} is="preview-content-dialog" class="py-3 px-4 w-full md:w-[50rem] rounded-md dark:bg-gray-950/80 dark:border-2 dark:border-orange-500 dark:text-white backdrop-filter backdrop-blur-3xl">
|
<dialog{{ attributes }} is="preview-content-dialog" class="py-3 px-4 w-full md:w-[{{ mdWidth|default('50rem') }}] rounded-md dark:bg-gray-950/80 dark:border-2 dark:border-orange-500 dark:text-white backdrop-filter backdrop-blur-3xl">
|
||||||
<div class="flex flex-row justify-end">
|
<div class="flex flex-row justify-end">
|
||||||
<twig:ux:icon name="ic:twotone-cancel" width="16.75px" height="16.75px" class="modal-close rounded-full align-middle text-red-600 hover:text-red-700" />
|
<twig:ux:icon name="ic:twotone-cancel" width="16.75px" height="16.75px" class="modal-close rounded-full align-middle text-red-600 hover:text-red-700" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
}
|
}
|
||||||
document.addEventListener('DOMContentLoaded', async function() {
|
document.addEventListener('DOMContentLoaded', async function() {
|
||||||
const modal = document.getElementById('previewModal');
|
const modal = document.getElementById('previewModal');
|
||||||
|
modal.setAttribute('mdWidth', '25rem');
|
||||||
let data = await fetch('/api/monitor/upcoming-episodes');
|
let data = await fetch('/api/monitor/upcoming-episodes');
|
||||||
data = (await data.json())['data'];
|
data = (await data.json())['data'];
|
||||||
|
|
||||||
@@ -47,7 +48,12 @@
|
|||||||
eventClick: function (data) {
|
eventClick: function (data) {
|
||||||
modal.display({
|
modal.display({
|
||||||
heading: data.event.title,
|
heading: data.event.title,
|
||||||
content: `<p>${data.event.startStr}</p>`
|
content: `
|
||||||
|
<div class="flex flex-col gap-4 justify-center items-center">
|
||||||
|
<img src="${data.event.extendedProps.attachment}" class="w-[90%] rounded-md" />
|
||||||
|
<p>${data.event.startStr}</p>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user