You've already forked Atomcms-edit
0c6c558a59
- Embed widget: standalone iframe player with dark/light/transparent themes, copy-paste embed code admin page - Real-time SSE: streaming now-playing/listeners/dj events, replaces polling in radio-player and embed - Song history: auto-records song changes to radio_song_plays table, Filament resource to view - DJ moderation: unified panel for shouts approval, song request queue, DJ applications - Auto DJ: playlist management with round-robin playback when no DJ is live - Refactored radio-player Alpine component to use EventSource API with auto-reconnect
152 lines
9.0 KiB
PHP
152 lines
9.0 KiB
PHP
<?php
|
|
|
|
use App\Models\RadioApplication;
|
|
use App\Models\RadioShout;
|
|
use App\Models\RadioSongRequest;
|
|
|
|
?>
|
|
|
|
<x-filament-panels::page>
|
|
<x-filament::tabs>
|
|
{{-- Shouts Tab --}}
|
|
<x-filament::tabs.tab
|
|
icon="heroicon-o-chat-bubble-oval-left"
|
|
label="Shouts ({{ RadioShout::where('approved', false)->count() }} wachtend, {{ RadioShout::where('reported', true)->count() }} gerapporteerd)"
|
|
>
|
|
<div class="space-y-4">
|
|
@php $pendingShouts = $this->getPendingShouts(); @endphp
|
|
@if($pendingShouts->count() > 0)
|
|
<h3 class="text-lg font-semibold">Wachtend op goedkeuring</h3>
|
|
<div class="space-y-2">
|
|
@foreach($pendingShouts as $shout)
|
|
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4 flex items-start justify-between gap-4">
|
|
<div class="flex-1 min-w-0">
|
|
<p class="font-medium text-sm">{{ $shout->user?->username ?? 'Onbekend' }}</p>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400 truncate">{{ $shout->message }}</p>
|
|
<p class="text-xs text-gray-400 mt-1">{{ $shout->created_at->diffForHumans() }}</p>
|
|
</div>
|
|
<div class="flex gap-2 shrink-0">
|
|
<x-filament::button wire:click="approveShout({{ $shout->id }})" color="success" size="xs" icon="heroicon-o-check">
|
|
Goedkeuren
|
|
</x-filament::button>
|
|
<x-filament::button wire:click="deleteShout({{ $shout->id }})" color="danger" size="xs" icon="heroicon-o-trash" onclick="return confirm('Zeker weten?')">
|
|
Verwijderen
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
{{ $pendingShouts->links() }}
|
|
</div>
|
|
@endif
|
|
|
|
@php $reportedShouts = $this->getReportedShouts(); @endphp
|
|
@if($reportedShouts->count() > 0)
|
|
<h3 class="text-lg font-semibold mt-6">Gerapporteerde shouts</h3>
|
|
<div class="space-y-2">
|
|
@foreach($reportedShouts as $shout)
|
|
<div class="bg-red-50 dark:bg-red-950 rounded-lg p-4 flex items-start justify-between gap-4">
|
|
<div class="flex-1 min-w-0">
|
|
<p class="font-medium text-sm">{{ $shout->user?->username ?? 'Onbekend' }}</p>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400 truncate">{{ $shout->message }}</p>
|
|
<p class="text-xs text-gray-400 mt-1">{{ $shout->created_at->diffForHumans() }}</p>
|
|
</div>
|
|
<div class="flex gap-2 shrink-0">
|
|
<x-filament::button wire:click="dismissShoutReport({{ $shout->id }})" color="info" size="xs" icon="heroicon-o-flag">
|
|
Negeren
|
|
</x-filament::button>
|
|
<x-filament::button wire:click="deleteShout({{ $shout->id }})" color="danger" size="xs" icon="heroicon-o-trash" onclick="return confirm('Zeker weten?')">
|
|
Verwijderen
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
{{ $reportedShouts->links() }}
|
|
</div>
|
|
@endif
|
|
|
|
@if($pendingShouts->count() === 0 && $reportedShouts->count() === 0)
|
|
<p class="text-gray-500 text-center py-8">Geen shouts wachtend op moderatie</p>
|
|
@endif
|
|
</div>
|
|
</x-filament::tabs.tab>
|
|
|
|
{{-- Song Requests Tab --}}
|
|
<x-filament::tabs.tab
|
|
icon="heroicon-o-musical-note"
|
|
label="Verzoeken ({{ RadioSongRequest::where('is_approved', false)->where('is_played', false)->count() }} wachtend)"
|
|
>
|
|
<div class="space-y-4">
|
|
@php $requests = $this->getPendingRequests(); @endphp
|
|
@if($requests->count() > 0)
|
|
<div class="space-y-2">
|
|
@foreach($requests as $request)
|
|
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4 flex items-start justify-between gap-4">
|
|
<div class="flex-1 min-w-0">
|
|
<p class="font-medium text-sm">{{ $request->user?->username ?? 'Onbekend' }}</p>
|
|
<p class="text-sm font-semibold">{{ $request->song_title }}</p>
|
|
<p class="text-sm text-gray-500" x-show="{{ $request->song_artist }}">{{ $request->song_artist }}</p>
|
|
<div class="flex items-center gap-3 mt-1">
|
|
<span class="text-xs text-gray-400">{{ $request->submitted_at->diffForHumans() }}</span>
|
|
<span class="text-xs text-amber-500">{{ $request->votes }} stemmen</span>
|
|
</div>
|
|
</div>
|
|
<div class="flex gap-2 shrink-0">
|
|
<x-filament::button wire:click="approveRequest({{ $request->id }})" color="success" size="xs" icon="heroicon-o-check">
|
|
Goedkeuren
|
|
</x-filament::button>
|
|
<x-filament::button wire:click="rejectRequest({{ $request->id }})" color="danger" size="xs" icon="heroicon-o-x-mark" onclick="return confirm('Zeker weten?')">
|
|
Afwijzen
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
{{ $requests->links() }}
|
|
</div>
|
|
@else
|
|
<p class="text-gray-500 text-center py-8">Geen verzoeken wachtend op goedkeuring</p>
|
|
@endif
|
|
</div>
|
|
</x-filament::tabs.tab>
|
|
|
|
{{-- Applications Tab --}}
|
|
<x-filament::tabs.tab
|
|
icon="heroicon-o-user-group"
|
|
label="Aanmeldingen ({{ RadioApplication::where('status', 'pending')->count() }} wachtend)"
|
|
>
|
|
<div class="space-y-4">
|
|
@php $applications = $this->getPendingApplications(); @endphp
|
|
@if($applications->count() > 0)
|
|
<div class="space-y-2">
|
|
@foreach($applications as $app)
|
|
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg p-4 flex items-start justify-between gap-4">
|
|
<div class="flex-1 min-w-0">
|
|
<p class="font-medium">{{ $app->user?->username ?? 'Onbekend' }}</p>
|
|
<p class="text-sm text-gray-600 dark:text-gray-400">
|
|
{{ $app->rank?->name ?? 'Geen functie' }} · {{ $app->age }} jaar
|
|
</p>
|
|
<p class="text-sm mt-2">{{ $app->motivation }}</p>
|
|
@if($app->experience)
|
|
<p class="text-xs text-gray-400 mt-1">Ervaring: {{ $app->experience }}</p>
|
|
@endif
|
|
<p class="text-xs text-gray-400 mt-1">{{ $app->created_at->diffForHumans() }}</p>
|
|
</div>
|
|
<div class="flex gap-2 shrink-0">
|
|
<x-filament::button wire:click="approveApplication({{ $app->id }})" color="success" size="xs" icon="heroicon-o-check" onclick="return confirm('Aanmelding goedkeuren?')">
|
|
Goedkeuren
|
|
</x-filament::button>
|
|
<x-filament::button wire:click="rejectApplication({{ $app->id }})" color="danger" size="xs" icon="heroicon-o-x-mark" onclick="return confirm('Aanmelding afwijzen?')">
|
|
Afwijzen
|
|
</x-filament::button>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
{{ $applications->links() }}
|
|
</div>
|
|
@else
|
|
<p class="text-gray-500 text-center py-8">Geen aanmeldingen wachtend</p>
|
|
@endif
|
|
</div>
|
|
</x-filament::tabs.tab>
|
|
</x-filament::tabs>
|
|
</x-filament-panels::page>
|