@extends('layouts.portal') @section('title', ($menu->title ?? __('menus.title')) . ' — ' . config('app.name')) @section('page_title', $menu->title ?? $menu->dietType?->name) @section('page_subtitle', $menu->patient?->full_name . ' · ' . $menu->starts_on?->format('Y-m-d') . ' · ' . $menu->duration_days . ' ' . __('common.days')) @section('page_actions') @unless ($menu->isIssued())
@csrf
@endunless {{ __('common.back') }} @endsection @section('content') {{-- Targets --}}

{{ __('patients.target_calories') }}

{{ number_format($menu->target_calories) }}

@foreach ([['protein', $menu->protein_g], ['carbs', $menu->carbs_g], ['fat', $menu->fat_g]] as [$label, $value])

{{ __('patients.' . $label) }}

{{ $value }}{{ __('common.grams') }}

@endforeach
{{-- Day by day --}}
@foreach ($menu->structure ?? [] as $index => $day) @php $total = $totals[$index] ?? null; @endphp

{{ __('common.day') }} {{ $day['day'] }} {{ $menu->starts_on?->copy()->addDays($day['day'] - 1)->format('D, d M') }}

@if ($total)
{{ number_format($total['calories']) }} {{ __('common.kcal') }} {{ $total['protein_g'] }}{{ __('common.grams') }} {{ __('patients.protein') }} {{ $total['carbs_g'] }}{{ __('common.grams') }} {{ __('patients.carbs') }} {{ $total['fat_g'] }}{{ __('common.grams') }} {{ __('patients.fat') }}
@endif
@foreach ($day['meals'] as $meal)

{{ __('menus.slots.' . $meal['slot']) }}

{{ $meal['target_calories'] }} {{ __('common.kcal') }}
    @forelse ($meal['items'] as $item)
  • {{ app()->getLocale() === 'ar' ? $item['name_ar'] : $item['name_en'] }} {{ $item['protein_g'] }}P · {{ $item['carbs_g'] }}C · {{ $item['fat_g'] }}F
    {{ $item['grams'] }}{{ __('common.grams') }}
  • @empty
  • {{ __('common.no_results') }}
  • @endforelse
@endforeach
@endforeach
@can('delete', $menu->patient)
@csrf @method('DELETE')
@endcan @endsection