{{-- resources/views/temperatures/today.blade.php --}} @extends('layouts.app') @section('title', 'Relevés températures') @section('styles') @endsection @section('content') {{-- Header collant --}}

Températures

{{ $period === 'morning' ? '☀ Matin' : '☽ Soir' }}

{{ $date }}

{{-- Barre de progression --}} @php $total = $status->count(); $done = $status->filter(fn($s) => $s[$period] !== null)->count(); $pct = $total > 0 ? round(($done / $total) * 100) : 0; $allDone = $done === $total && $total > 0; @endphp
{{ $done }}/{{ $total }} enceintes relevées {{ $pct }} %
{{-- Liste des enceintes --}}
@forelse($status as $item) @php $unit = $item['unit']; $reading = $item[$period]; $isDone = $reading !== null; $isOk = $isDone && $reading->is_compliant; $isKo = $isDone && ! $reading->is_compliant; $cardClass = $isDone ? ($isOk ? 'is-ok' : 'is-ko') : ''; @endphp
{{-- En-tête de la carte --}}
{{ $unit->number }}

{{ $unit->name }}

Cible : @if($unit->target_temp_min !== null) {{ $unit->target_temp_min }} °C / @endif ≤ {{ $unit->target_temp_max }} °C

@if($isDone && $isOk) @elseif($isDone && $isKo) ! @else @endif
{{-- Relevé déjà fait --}} @if($isDone)
{{ number_format($reading->temperature, 1) }} °C
{{ $reading->recorded_at->format('H:i') }} par {{ $reading->user->name }}
@if($isKo && $reading->corrective_action)
{{ $reading->corrective_action }}
@endif {{-- Formulaire de saisie --}} @else
°C
{{-- Champ action corrective (affiché si hors norme) --}}
Action corrective obligatoire
@endif
@empty

Aucune enceinte configurée.

Ajouter une enceinte
@endforelse
{{-- FAB --}} @if($total > 0)
@endif {{-- Toast feedback --}}
@endsection @push('scripts') @endpush