@php /** * What a map pin says when a diner opens it. * * The pin used to carry the restaurant's name and nothing else, which asked the diner to leave the * map to learn anything — whether it is open, whether it is any good, what it sells, what delivery * costs. All four are here, so the choice can be made on the map and only the order takes them off * it. * * READ TOP TO BOTTOM: who it is, whether you can order now, what they sell, how to get it. Each of * those is its own band with the same padding, separated by the same hairline the rest of the * product uses, so the card has one rhythm rather than four. * * Rendered on the SERVER and handed to the map layer as a string, so prices go through money(), * ratings through number_format(), times through the site's own formatter and every label through * the translator. None of that belongs in the map script. * * @var array $r the restaurant row * @var array $dishes up to a handful of its available items * @var array|null $window ['open' => bool, 'close' => 'HH:MM:SS'] for today, or null if none set */ $slug = (string) ($r['slug'] ?? ''); $href = url('/restaurant/' . $slug); $isOpen = $window === null ? true : (bool) $window['open']; $closes = $window['close'] ?? ''; @endphp
{{ $r['name'] }}

{{ number_format((float) ($r['rating_cache'] ?? 0), 1) }} @if ((int) ($r['rating_count'] ?? 0) > 0)({{ (int) $r['rating_count'] }})@endif @if (($r['cuisine_name'] ?? '') !== '')· {{ $r['cuisine_name'] }}@endif

@php /* Open or shut, and until when. "Open" alone does not tell a diner whether there is still time to order, which is the only reason they are reading it. */ @endphp

{!! $isOpen ? t('geo.open_now') : t('geo.closed_now') !!} @if ($isOpen && $closes !== '') {!! t_raw('geo.closes_at', [':time' => fmt_clock($closes)]) !!} @endif

@if ($dishes) @php /* A few of its dishes, moved by the same arrow pair the cuisine and "popular this week" rails use. Arrows rather than a scrollbar: a scrollbar inside a 320px card is a target nobody can hit, and the product already has this control. */ @endphp @endif @php /* The two ways to get it, each carrying its own cost. A diner choosing between kitchens is really choosing between these, so the price of each belongs on the choice itself. */ @endphp
{{ t_raw('checkout.delivery') }} {!! (float) ($r['delivery_fee'] ?? 0) > 0 ? money($r['delivery_fee']) : t('geo.mode_free') !!} {{ t_raw('checkout.pickup') }} {{ t_raw('geo.mode_no_fee') }}