wip-feat: adds functionality to Monitor button

This commit is contained in:
2025-05-08 22:48:25 -05:00
parent b93da3df1d
commit 5ff9842eaa
7 changed files with 169 additions and 13 deletions

View File

@@ -81,7 +81,7 @@
{% if results.media.mediaType == "tvshows" %}
<div class="flex flex-row gap-2 justify-end px-8">
<button class="px-1.5 py-1 bg-green-600 rounded-md text-sm"
<button class="px-1.5 py-1 bg-green-600 hover:bg-green-700 rounded-md text-sm"
{{ stimulus_target('result_filter', 'downloadSelected') }}
{{ stimulus_action('result_filter', 'downloadSelectedEpisodes', 'click') }}
>Download Selected</button>

View File

@@ -14,18 +14,45 @@
<h3 class="text-xl font-medium leading-tight font-bold text-gray-50">
{{ results.media.title }} - {{ results.media.year }}
</h3>
<button class="px-1.5 py-1 bg-green-600 text-white rounded-md cursor-pointer"
{{ stimulus_controller('monitor', {
tmdbId: results.media.tmdbId,
imdbId: results.media.imdbId,
title: results.media.title
}) }}
{% if results.media.mediaType == "movies" %}
{{ stimulus_action('monitor', 'addMovieMonitor', 'click') }}
{% endif %}
<div {{ stimulus_controller('monitor_button', {
tmdbId: results.media.tmdbId,
imdbId: results.media.imdbId,
title: results.media.title,
})}}
data-monitor-button-result-filter-outlet="#filter"
>
Monitor
</button>
<button data-monitor-button-target="button" {{ stimulus_action('monitor_button', 'toggle', 'click') }} class="h-8 text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-2 py-1.5 text-center inline-flex items-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800" type="button">
Monitor
<svg class="w-2.5 h-2.5 ms-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
</svg>
</button>
<!-- Dropdown menu -->
<div data-monitor-button-target="options" class="absolute mt-1 right-12 z-40 hidden bg-white divide-y rounded-lg shadow-sm w-44 dark:bg-green-600 backdrop-filter backdrop-blur-md bg-opacity-60">
<ul class="py-2 text-sm text-gray-700 dark:text-gray-200" aria-labelledby="dropdownDefaultButton">
<li {{ stimulus_action('monitor_button', 'monitorSeries', 'click') }}>
<button class="px-4 py-2 hover:bg-green-700 w-full text-left">
Entire Series
</button>
</li>
<li {{ stimulus_action('monitor_button', 'monitorSeason', 'click') }}>
<button class="px-4 py-2 hover:bg-green-700 w-full text-left">
Season
</button>
</li>
<li {{ stimulus_action('monitor_button', 'monitorEpisode', 'click') }}>
<button class="px-4 py-2 hover:bg-green-700 w-full text-left">
Episode
</button>
</li>
</ul>
</div>
</div>
</div>
<p class="text-gray-50">
{{ results.media.description }}