@section('title', __('general.page_dashboard_title')) @section('head') @endsection @php $counters = [ [ 'label' => __('general.dash_card_requests'), 'value' => $pendReq, 'icon' => 'fa-music', 'color' => '#2476d8', 'tint' => '#eaf2fd', 'url' => Route::has('site.music-requests.r') ? route('site.music-requests.r') : null, ], [ 'label' => __('general.dash_card_messages'), 'value' => $pendMes, 'icon' => 'fa-envelope', 'color' => '#7a3fb8', 'tint' => '#f3edfb', 'url' => Route::has('site.messages.r') ? route('site.messages.r') : null, ], [ 'label' => __('general.dash_card_comments'), 'value' => $pendCom, 'icon' => 'fa-comment-dots', 'color' => '#d97706', 'tint' => '#fdf3e3', 'url' => Route::has('site.comments.r') ? route('site.comments.r') : null, ], ]; $social = social_links($socialData); /* o programa no ar e o proximo chegam junto com a grade, do controlador */ $onAirProgram = $onAirProgram ?? null; $nextProgram = $nextProgram ?? null; $isOwner = site_role() === 'owner'; @endphp @include('includes/header-novo')
@if(session('serverID') == '333')
{{ __('general.dash_network_notice') }} {{ __('general.dash_network_notice_2') }}
@endif

{{ $siteData->name }}

{{ __('general.dash_schedule_title') }} @if(Route::has('site.scheduling.r')) {{ __('general.dash_schedule_action') }} @endif
@if(!$onAirProgram && !$nextProgram)

{{ __('general.dash_schedule_empty_desc') }}

@else
{{ __('general.dash_on_air') }} {{ $onAirProgram->name ?? __('general.dash_schedule_empty') }} @if($onAirProgram) {{ substr($onAir[0]->start_time, 0, 5) }} - {{ substr($onAir[0]->end_time, 0, 5) }} @endif
{{ __('general.dash_next_program') }} {{ $nextProgram->name ?? __('general.value_not_set') }} @if($nextProgram) {{ substr($nextAir[0]->start_time, 0, 5) }} - {{ substr($nextAir[0]->end_time, 0, 5) }} @endif
@endif
@foreach($counters as $c) <{{ $c['url'] ? 'a' : 'div' }} class="metric" @if($c['url']) href="{{ $c['url'] }}" @endif style="--metric-color:{{ $c['color'] }};--metric-tint:{{ $c['tint'] }};">
{{ $c['value'] }}
{{ $c['label'] }}
@if($c['url'])@endif @endforeach

{{ __('general.dash_settings_title') }}

{{ __('general.action_change') }}
{{ __('general.label_timezone') }} {{ $siteData->timezone == 'America/Sao_Paulo' ? __('general.timezone_brasilia') : $siteData->timezone }}
{{ __('general.label_contact_email') }} {{ $contactData->contact_email ?? $userLogged->email }}
{{ __('general.label_address') }} {{ $contactData->contact_address ?? __('general.value_not_set') }}
@if($isOwner)

{{ __('general.page_users_h1') }}

{{ __('general.dash_admins_invite') }}
{{ mb_strtoupper(mb_substr($userLogged->name, 0, 1)) }} {{ $userLogged->name }} {{ __('general.role_owner') }} {{ DateShort($userLogged->last_login) }}
@php /** * One query for the admins of this site instead of two * inside the loop. The old block also tested a variable * that never existed, so no invited admin was ever shown. */ $adminIds = $logsData ? collect($logsData)->pluck('user_id')->all() : []; $adminUsers = $adminIds ? DB::table('users')->whereIn('id', $adminIds)->get()->keyBy('id') : collect(); $adminRows = $adminIds ? DB::connection('mysql_site_' . session('serverID'))->table('administrators') ->where('site_id', '=', session('siteID'))->whereIn('user_id', $adminIds)->get()->keyBy('user_id') : collect(); @endphp @forelse($adminIds as $adminId) @php $person = $adminUsers[$adminId] ?? null; $row = $adminRows[$adminId] ?? null; @endphp @continue(!$person)
{{ mb_strtoupper(mb_substr($person->name, 0, 1)) }} {{ $row->nickname ?? $person->name }} @if($row && $row->active) {{ __('general.role_admin') }} @else {{ __('general.dash_admins_invited') }} @endif {{ $person->last_login ? DateShort($person->last_login) : '' }}
@empty {{ __('general.dash_admins_manage') }} @endforelse
@endif @if($isOwner)

{{ __('general.dash_activities_title') }}

{{ __('general.dash_activities_link') }}
@forelse($lastActivities as $activity)
{{ log_action_label($activity->action) }} {{ $activity->user_name }} · {{ DateShort($activity->created_at) }}
@empty

{{ __('general.dash_activities_empty') }}

{{ __('general.dash_activities_empty_hint') }}

@endforelse
@endif
@include('includes/footer-novo')