@extends('layouts.app') @section('title', 'Logs — ' . $batch->name) @section('content')
← {{ $batch->name }}
{{ __('batches.show.logs_title') }}

{{ $batch->guide->name }}@if($batch->recipe) · Receta: {{ $batch->recipe->name }}@endif

@if($batch->status === 'active') + Log de hoy @endif
{{-- Receta e ingredientes, plegados: a un vistazo cuál fue la receta base y qué se echó (las cantidades congeladas al crear la tanda). Sobre todo en una terminada. --}} @php $user = auth()->user(); $inicioReal = $batch->start_date ? $user->aSuHora($batch->fermentationStartedAt()) : null; $conHora = $batch->start_date && $batch->fermentationStartedAt()->format('H:i:s') !== '00:00:00'; @endphp
Receta e ingredientes {{ $batch->recipe?->name ?? 'Sin receta base' }} @if($batch->target_yield_value) · {{ rtrim(rtrim(number_format((float) $batch->target_yield_value, 2, ',', '.'), '0'), ',') }} {{ $batch->target_yield_unit }}@endif @if($inicioReal) · inicio {{ $inicioReal->format('d/m/Y') }}@if($conHora) {{ $inicioReal->format('H:i') }}@endif @endif
@if($batch->recipe)
Receta base
{{ $batch->recipe->name }}@if($batch->recipe->is_official) Clásica@endif
@if($batch->recipe->description)

{{ $batch->recipe->description }}

@endif
@endif @forelse($ingredientesPorPaso as $titulo => $lineas)
{{ $titulo !== '' ? 'Paso ' . $titulo : 'Ingredientes' }}
    @foreach($lineas as $ing)
  • {{ $ing->name }} @if($ing->quantity !== null){{ app(\App\Services\UnitService::class)->format((float) $ing->quantity, $ing->unit ?? 'unit', $user) }}@else — @endif
  • @endforeach
@empty

Esta tanda no guardó ingredientes.

@endforelse
@forelse($logs as $log)
Día {{ $log->day_number }} {{ $log->date->format('d/m/Y') }}
@if($log->mood) {{ $log->mood === 'good' ? '😊 Bien' : ($log->mood === 'bad' ? '😟 Mal' : '🤔 Raro') }} @endif
@if($log->notes) {{-- Cada apunte lleva su hora en la línea («08:15 · …», DailyLog::anotar). --}}

{{ $log->notes }}

@endif @if($log->measurements->count() > 0) @php $frases = $frases ?? $batch->frasesDeCata(); @endphp
@foreach($log->measurements as $m) {{-- Con la HORA de cada medida o cata: en un fermento de horas es el dato. --}} @php $horaM = $m->created_at ? $user->aSuHora($m->created_at)->format('H:i') : null; @endphp @if($m->type === 'cata') {{-- La DECISIÓN a paladar, con su frase — es el hilo del bucle 2, no un número (correctura 10-ago). --}} @if($horaM){{ $horaM }}@endif👅 {{ $frases[(int) $m->value] ?? 'Cata' }} @else @if($horaM){{ $horaM }}@endif{{ \App\Models\Measurement::LABELS[$m->type] ?? $m->type }}: {{ rtrim(rtrim(number_format((float) $m->value, 2, ',', ''), '0'), ',') }} {{ $m->unit }} @endif @endforeach
@endif
@empty
📋
Sin logs todavía
Empieza a registrar el progreso diario
@endforelse @if($logs->hasPages())
{{ $logs->links() }}
@endif @endsection