86 lines
4.9 KiB
PHP
86 lines
4.9 KiB
PHP
@auth
|
|
<div
|
|
data-te-modal-init
|
|
id="modalAddToPlaylist"
|
|
tabindex="-1"
|
|
aria-modal="true"
|
|
role="dialog"
|
|
class="fixed inset-0 z-[1055] hidden overflow-y-auto bg-black/60 backdrop-blur-sm"
|
|
>
|
|
<div data-te-modal-dialog-ref class="flex min-h-screen items-center justify-center p-4">
|
|
<div class="relative w-full max-w-2xl overflow-hidden rounded-2xl border border-neutral-200 bg-white shadow-2xl dark:border-neutral-700 dark:bg-neutral-900">
|
|
<x-modal-header :title="__('Add to Playlist')" />
|
|
|
|
<!--Modal body-->
|
|
<div class="relative p-4">
|
|
@php $playlists = Auth::user()->playlists; @endphp
|
|
|
|
@if (count($playlists) > 0)
|
|
<!-- Add to existing playlist -->
|
|
<div class="p-4">
|
|
<label class="mb-2 leading-tight text-gray-800 dark:text-gray-200 w-full" for="playlist">Select Playlist:</label>
|
|
<select name="playlist" id="playlist" class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-rose-800 focus:border-rose-900 dark:bg-neutral-900 dark:border-neutral-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-rose-800 dark:focus:border-rose-900">
|
|
@foreach($playlists as $playlist)
|
|
<option value="{{ $playlist->id }}">
|
|
{{ $playlist->name }} -
|
|
{{ $playlist->is_private == 1 ? 'Private' : 'Public' }} -
|
|
{{ $playlist->episodes->count() }} Episodes
|
|
{{ $playlist->episodes->contains('episode_id', $episode->id) ? '- Episode Already Added' : '' }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
<x-input-error :messages="$errors->get('playlist')" class="mt-2" />
|
|
</div>
|
|
|
|
<div class="flex flex-shrink-0 flex-wrap items-center justify-end rounded-b-md p-4 gap-3">
|
|
<a
|
|
data-te-modal-dismiss
|
|
id="playlist-cancel"
|
|
class="cursor-pointer rounded-xl border border-neutral-300 px-5 py-2.5 text-sm font-medium text-neutral-700 transition hover:bg-neutral-100 dark:border-neutral-600 dark:text-neutral-200 dark:hover:bg-neutral-800">
|
|
Cancel
|
|
</a>
|
|
<a
|
|
id="playlist-add"
|
|
class="cursor-pointer rounded-xl bg-rose-600 px-5 py-2.5 text-sm font-semibold text-white shadow-lg shadow-rose-600/20 transition hover:bg-rose-700">
|
|
Add
|
|
</a>
|
|
</div>
|
|
|
|
<hr class="my-4 border-neutral-200 dark:border-neutral-700">
|
|
|
|
<p class="px-4 text-sm font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wide">Or Create a New Playlist</p>
|
|
@else
|
|
<p class="px-4 text-sm text-neutral-600 dark:text-neutral-400">
|
|
No Playlists found. Create one below!
|
|
</p>
|
|
@endif
|
|
|
|
<!-- Create new playlist -->
|
|
<div class="p-4">
|
|
<label class="mb-2 leading-tight text-gray-800 dark:text-gray-200 w-full" for="playlist-name">Playlist Name:</label>
|
|
<x-text-input id="playlist-name" class="block mt-1 w-full" type="text" name="name" maxlength="30" required />
|
|
<x-input-error :messages="$errors->get('name')" class="mt-2" />
|
|
</div>
|
|
|
|
<div class="p-4">
|
|
<label class="mb-2 leading-tight text-gray-800 dark:text-gray-200 w-full" for="playlist-visibility">Visibility:</label>
|
|
<select name="visiblity" id="playlist-visibility" class="block w-full text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-rose-800 focus:border-rose-900 dark:bg-neutral-900 dark:border-neutral-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-rose-800 dark:focus:border-rose-900">
|
|
<option value="public">Public</option>
|
|
<option value="private" selected>Private</option>
|
|
</select>
|
|
<x-input-error :messages="$errors->get('visiblity')" class="mt-2" />
|
|
</div>
|
|
|
|
<div class="flex flex-shrink-0 flex-wrap items-center justify-end rounded-b-md p-4">
|
|
<a
|
|
id="playlist-create-and-add"
|
|
class="cursor-pointer rounded-xl bg-rose-600 px-5 py-2.5 text-sm font-semibold text-white shadow-lg shadow-rose-600/20 transition hover:bg-rose-700">
|
|
Create and Add Episode
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@vite(['resources/js/modals-playlist.js'])
|
|
@endauth |