@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
{!! $isOpen ? t('geo.open_now') : t('geo.closed_now') !!} @if ($isOpen && $closes !== '') {!! t_raw('geo.closes_at', [':time' => fmt_clock($closes)]) !!} @endif
{{ $d['name'] }}
{{ money($d['price']) }}
@endforeach