@extends('layouts/layoutMaster') @section('title', 'Opiniones - Panel Mariachi') @section('content') @if(session('status'))
{{ session('status') }}
@endif @if($errors->any())
@endif @php $statusMap = [ 'pending' => ['label' => 'Pendiente', 'class' => 'warning'], 'approved' => ['label' => 'Aprobada', 'class' => 'success'], 'rejected' => ['label' => 'Rechazada', 'class' => 'danger'], 'reported' => ['label' => 'Reportada', 'class' => 'info'], 'hidden' => ['label' => 'Oculta', 'class' => 'secondary'], ]; $verificationMap = [ 'basic' => ['label' => 'Opinion basica', 'class' => 'secondary'], 'manual_validated' => ['label' => 'Validada manualmente', 'class' => 'primary'], 'evidence_attached' => ['label' => 'Con foto/prueba', 'class' => 'info'], ]; $totalForDistribution = max($totalApproved, 1); $statusTotalForChart = max((int) $totalReviews, 1); $weeklyIsPositive = $weeklyGrowthPercentage >= 0; $weeklyGrowthLabel = ($weeklyIsPositive ? '+' : '').number_format($weeklyGrowthPercentage, 1).'%'; @endphp

{{ number_format($averageRating, 1) }}

Total {{ $totalApproved }} opiniones publicas

Metrica sobre opiniones aprobadas y visibles.

+{{ $thisWeekReviews }} esta semana
@foreach([5,4,3,2,1] as $rating) @php $count = (int) ($ratingDistribution[$rating] ?? 0); $width = (int) round(($count / $totalForDistribution) * 100); @endphp
{{ $rating }} Star
{{ $count }}
@endforeach
Reviews statistics

{{ $thisWeekReviews }} nuevas opiniones {{ $weeklyGrowthLabel }}

{{ $positivePercentage }}%opiniones positivas
Reporte semanal vs semana anterior
@foreach($statusMap as $status => $meta) @php $statusCount = (int) ($statusTotals[$status] ?? 0); $statusWidth = (int) round(($statusCount / $statusTotalForChart) * 100); @endphp
{{ $meta['label'] }}
{{ $statusCount }}
@endforeach
@if($reviews->isEmpty())

No hay opiniones para este filtro.

@else
@foreach($reviews as $review) @php $statusMeta = $statusMap[$review->moderation_status] ?? ['label' => $review->moderation_status, 'class' => 'secondary']; $verificationMeta = $verificationMap[$review->verification_status] ?? ['label' => $review->verification_status, 'class' => 'secondary']; $clientName = $review->clientUser?->display_name ?: 'Cliente'; $listingTitle = $review->mariachiListing?->title ?: 'Anuncio sin titulo'; @endphp
{{ $clientName }}

{{ $listingTitle }}

{{ $statusMeta['label'] }} {{ $verificationMeta['label'] }} @if($review->is_spam) Posible spam @endif @if($review->has_offensive_language) Lenguaje sensible @endif

{{ str_repeat('★', $review->rating) }}{{ str_repeat('☆', 5 - $review->rating) }} · {{ $review->event_type ?: 'Evento sin tipo' }} · {{ $review->event_date?->format('Y-m-d') ?: 'Sin fecha de evento' }}

Enviada: {{ $review->created_at->format('Y-m-d H:i') }}

@if($review->title)

{{ $review->title }}

@endif

{{ $review->comment }}

@if($review->photos->isNotEmpty())
@foreach($review->photos as $photo) Foto adjunta @endforeach
@endif @if($review->mariachi_reply)

Tu respuesta publica

{{ $review->mariachi_reply }}

{{ $review->mariachi_replied_at?->format('Y-m-d H:i') ?: '' }} @if(! $review->mariachi_reply_visible) · Oculta por moderacion @endif

@endif @if($review->latest_report_reason)

Ultimo reporte: {{ $review->latest_report_reason }}

@endif
@csrf
@csrf
@endforeach
@endif
@endsection