@if (!session()->has('selectedDevice'))
{{ __('Please select a device first') }}
@else
{{ __('Group Sender') }}
@if (!$broadcasts->isEmpty()) @endif {{ __('Templates') }} {{ __('Create Broadcast') }}
@if ($broadcasts->isEmpty())

{{ __('No broadcasts found') }}

{{ __('Create First Broadcast') }}
@else
@foreach ($broadcasts as $broadcast)
{{ $broadcast->name }}
@php $statusColors = [ 'draft' => 'secondary', 'scheduled' => 'warning', 'sending' => 'info', 'completed' => 'success', 'partial' => 'warning', 'failed' => 'danger', ]; @endphp {{ __(ucfirst($broadcast->status)) }}
{{ count($broadcast->targets ?? []) }} {{ __('groups') }} {{ __(ucfirst($broadcast->message_type)) }} @if ($broadcast->mention_type !== 'none') {{ __(ucfirst($broadcast->mention_type)) }} @endif
@if ($broadcast->scheduled_at)
{{ $broadcast->scheduled_at->format('d M Y H:i') }}
@endif @if (!empty($broadcast->repeat_type) && $broadcast->repeat_type !== 'none')
@switch($broadcast->repeat_type) @case('hourly') {{ __('Every :n hour(s)', ['n' => $broadcast->repeat_interval ?? 1]) }} @break @case('daily') {{ __('Daily') }} @break @case('weekly') {{ __('Weekly') }} @break @case('monthly') {{ __('Monthly') }} @break @case('yearly') {{ __('Yearly') }} @break @endswitch @if ($broadcast->next_run) {{ __('Next') }}: {{ $broadcast->next_run->format('d M Y H:i') }} @endif
@endif @php $sentCount = $broadcast->logs->where('status', 'sent')->count(); $failedCount = $broadcast->logs->where('status', 'failed')->count(); $totalLogs = $broadcast->logs->count(); $totalTarget = count($broadcast->targets ?? []); @endphp {{-- Progress bar (static from DB, updated live via Socket.IO) --}} @if ($broadcast->status === 'sending' || $totalLogs > 0)
{{ $sentCount }} {{ __('sent') }} @if ($failedCount > 0) · {{ $failedCount }} {{ __('failed') }} @endif @if($broadcast->status === 'sending') {{ __('Sending...') }} @else {{ $sentCount + $failedCount }}/{{ $totalTarget }} @endif
@endif {{-- Logs detail (collapsible) --}} @if ($totalLogs > 0)
@foreach ($broadcast->logs->sortByDesc('created_at') as $log)
{{ $log->group_name ?: $log->group_id }} {{ $log->created_at ? $log->created_at->format('d M H:i') : '' }} {{ $log->status }}
@endforeach
@endif
{{ $broadcast->created_at->diffForHumans() }}
@if (in_array($broadcast->status, ['draft', 'scheduled', 'partial', 'failed'])) @endif @if ($failedCount > 0) @endif
@endforeach
{{ $broadcasts->links() }}
@endif @endif