@extends('layouts.dashboard') @section('content') @php /** * Admin โ Reviews โ moderate one review. The reviewer, restaurant and linked * order are read-only provenance (a review is bound one-to-one to its order); * only the moderator-owned rating / comment / status are editable. Saving * recomputes the restaurant's cached rating (ReviewController::save()). * * @var array $review joined review row (restaurant_name/logo, customer_name/avatar/email, order_number) * @var array $authorHistory this reviewer's other reviews (up to 10, newest first) * @var array|null $authorSummary reviews_c / avg_rating / low_c / first_at for this reviewer */ $statusPill = ['approved' => 'qm-pill-green', 'pending' => 'qm-pill-amber']; $authorHistory = $authorHistory ?? []; $authorSummary = $authorSummary ?? null; $reviewerName = (string) ($review['customer_name'] ?? '') !== '' ? (string) $review['customer_name'] : ((string) ($review['author_name'] ?? '') !== '' ? (string) $review['author_name'] : t_raw('admin.reviewdetail.guest')); @endphp @php /* .qm-d2: the dashboard density standard (app.css ยง35) */ @endphp
| {{ t_raw('nav.restaurants') }} | {{ t_raw('common.rating') }} | {{ t_raw('admin.reviews.col_review') }} | {{ t_raw('common.status') }} | {{ t_raw('admin.reviews.col_posted') }} | {{ t_raw('common.actions') }} |
|---|---|---|---|---|---|
| {!! or_dash($h['restaurant_name'] ?? null) !!} | {!! rating_stars_html((float) (int) $h['rating']) !!} | {!! or_dash($h['comment'] ?? null) !!} |
{{ status_label('review', (string) $h['status']) }} | {!! fmt_day($h['created_at']) !!} | @partial('row-actions', ['actions' => [ ['label' => t_raw('admin.reviews.aria_edit'), 'icon' => 'fa-pen', 'href' => '/admin/reviews/' . (int) $h['id'], 'primary' => true], ]]) |