movie-night-nuevo/resources/views/livewire/lists.blade.php

68 lines
3.3 KiB
PHP
Raw Normal View History

2025-12-13 19:33:52 -06:00
<div class="mt-5 w-full mx-auto flex flex-col gap-5">
<h1 class="font-bold text-3xl mx-2 sm:mx-0">Lists</h1>
<x-ui.card>
2025-12-12 23:07:04 -06:00
<div class="w-full flex flex-col gap-2">
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li class="text-red-500">{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
2025-12-13 19:33:52 -06:00
<form class="flex flex-col max-w-lg gap-2" wire:submit.prevent="addList">
<label class="font-bold" for="list_name">Add List</label>
2025-12-12 23:07:04 -06:00
<div class="flex">
2025-12-13 19:33:52 -06:00
<input name="list_name" placeholder="List Name"
class="flex-1 w-full text-black bg-white p-2 rounded rounded-r-none"
type="text"
2025-12-15 23:53:07 -06:00
wire:model.live="form.name">
2025-12-12 23:07:04 -06:00
<button type="submit" class="bg-green-400 text-white px-4 py-2 rounded rounded-l-none">Add</button>
</div>
</form>
</div>
2025-12-30 21:15:42 -06:00
<div class="w-full flex flex-col gap-5">
<h2 class="text-2xl font-bold">Your Lists</h2>
@if(!$lists->isEmpty())
2025-12-31 00:11:09 -06:00
<ul class="w-full flex flex-col gap-3">
2025-12-30 21:15:42 -06:00
@foreach($lists as $list)
2025-12-31 00:11:09 -06:00
<li class="flex justify-between items-center p-4 bg-gray-700/50 rounded-lg hover:bg-gray-600/50 transition-colors">
<a class="text-xl hover:text-amber-200 transition-colors" href="/lists/{{$list->id}}" wire:navigate>{{$list->name}}</a>
2025-12-30 21:15:42 -06:00
@if((bool)$list->is_public === true)
2025-12-31 00:11:09 -06:00
<i class="fa fa-earth text-green-400" title="Public" aria-label="Public"></i>
2025-12-30 21:15:42 -06:00
@else
2025-12-31 00:11:09 -06:00
<i class="fa fa-lock text-gray-400" title="Private" aria-label="Private"></i>
2025-12-30 21:15:42 -06:00
@endif
</li>
@endforeach
</ul>
@else
2025-12-31 00:11:09 -06:00
<span class="text-gray-400">No lists found.</span>
2025-12-30 21:15:42 -06:00
@endif
</div>
<div class="w-full flex flex-col gap-5">
<h2 class="text-2xl font-bold">Shared With You</h2>
@if(!$sharedLists->isEmpty())
2025-12-31 00:11:09 -06:00
<ul class="w-full flex flex-col gap-3">
2025-12-30 21:15:42 -06:00
@foreach($sharedLists as $list)
2025-12-31 00:11:09 -06:00
<li class="flex justify-between items-center p-4 bg-gray-700/50 rounded-lg hover:bg-gray-600/50 transition-colors">
<a class="text-xl hover:text-amber-200 transition-colors" href="/lists/{{$list->id}}" wire:navigate>{{$list->name}}</a>
2025-12-30 21:15:42 -06:00
@if((bool)$list->is_public === true)
2025-12-31 00:11:09 -06:00
<i class="fa fa-earth text-green-400" title="Public" aria-label="Public"></i>
2025-12-30 21:15:42 -06:00
@else
2025-12-31 00:11:09 -06:00
<i class="fa fa-lock text-gray-400" title="Private" aria-label="Private"></i>
2025-12-30 21:15:42 -06:00
@endif
</li>
@endforeach
</ul>
@else
2025-12-31 00:11:09 -06:00
<span class="text-gray-400">No lists found.</span>
2025-12-30 21:15:42 -06:00
@endif
</div>
2025-12-13 19:33:52 -06:00
</x-ui.card>
2025-12-12 23:07:04 -06:00
</div>