@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())
@endunless {{ __('common.back') }} @endsection @section('content') {{-- Calorie & macro preview — editable after generation. Daily EER (target_calories) and the protein/carbs/fat split can be nudged by the consultant without regenerating the whole meal structure; the split is entered as percentages and must add up to 100%, mirroring the onsite-consultation wizard's macro sliders. Grams shown here and saved to the menu are recomputed from calories × percent (protein/carbs at 4 kcal/g, fat at 9 kcal/g) — same formulas as NutritionCalculator::macros(). --}} @php $proteinPercent = $menu->target_calories > 0 ? round(($menu->protein_g * 4 / $menu->target_calories) * 100) : 25; $carbsPercent = $menu->target_calories > 0 ? round(($menu->carbs_g * 4 / $menu->target_calories) * 100) : 45; $fatPercent = $menu->target_calories > 0 ? round(($menu->fat_g * 9 / $menu->target_calories) * 100) : 30; @endphp{{ $message }}
@enderror {{-- Read-only view --}}{{ __('patients.target_calories') }}
{{ number_format($menu->target_calories) }}
{{ __('patients.' . $label) }}
{{ $value }}{{ __('common.grams') }}
{{ $pct }}%