@extends('layouts.dashboard') @section('content') @php use App\Models\AdCampaign; /** * Vendor → Sponsored ads → one placement. The owner's full view of their campaign: * creative at real size, buy facts, and the moderation trail — including the reason a * rejected one was rejected. While the placement is still pending and unpaid its content * can be corrected here (the one window where nothing has been decided or charged); * after that the page is read-only. Saving never moves status: the state machine * (pending → approved → active once paid) belongs to moderation and payment. * * @var array $c campaign row (+ dish_*) * @var array $history moderation events, newest first * @var bool $editable pending + unpaid * @var array $menuItems this restaurant's dishes (only when editable) */ $status = (string) $c['status']; $statusPill = static function (string $s): string { return match ($s) { 'active', 'approved' => 'qm-pill-green', 'pending' => 'qm-pill-amber', 'rejected', 'expired' => 'qm-pill-red', default => 'qm-pill-grey', }; }; $decidedVerb = static function (string $action): string { return match ($action) { 'approve' => t('admin.campaigns.decided_approved'), 'reject' => t('admin.campaigns.decided_rejected'), 'mark_paid' => t('admin.campaigns.decided_marked_paid'), 'edit' => t('admin.campaigns.decided_edited'), default => ucfirst(str_replace('_', ' ', $action)), }; }; $placement = (string) $c['placement']; $creative = (string) ($c['image'] ?? ''); $isVideo = $creative !== '' && str_ends_with(strtolower($creative), '.mp4'); $coverSrc = !$isVideo && $creative !== '' ? $creative : (string) ($c['dish_image'] ?? ''); @endphp @php /* .qm-d2: the dashboard density standard (app.css §35) */ @endphp
{{ status_label('ad_placement', $placement) }}
@endif
@if ($editable)
@else
@php /* Decided or paid: the creative is the record of what was bought/reviewed. */
@endphp
@if (AdCampaign::placementUses($placement, 'body') && !empty($c['body']))
{{ (string) $c['body'] }}
@endif @endif| {{ t_raw('admin.reservationdetail.col_change') }} | {{ t_raw('common.description') }} | {{ t_raw('common.when') }} |
|---|---|---|
| @if (!empty($h['from_status']) && !empty($h['to_status']) && $h['from_status'] !== $h['to_status']) {{ status_label('campaign', (string) $h['from_status']) }} {{ status_label('campaign', (string) $h['to_status']) }} @else {!! $decidedVerb((string) $h['action']) !!} @endif | {!! or_dash($h['admin_note'] ?? null) !!} |
{{ time_ago($h['created_at']) }} |