{{-- Backdrop --}} @if($isOpen)
@endif {{-- Unsaved Changes Confirmation --}}

Unsaved Changes

You have unsaved changes. Are you sure you want to close?

{{-- Slide Panel --}}
@if($isOpen) {{-- Header --}}
@if($isNewSample)

New Sample

@else @php $colourway = $this->sample?->colourways; $design = $colourway?->style_versions?->styles?->designs; @endphp {{ $design?->id }}

{{ Str::limit($design?->description, 30) }}

@endif @if($isDirty) Unsaved @endif
{{-- Toast Notifications --}} @if(session()->has('message'))
{{ session('message') }}
@endif @if(session()->has('error'))
{{ session('error') }}
@endif {{-- Tabs --}} {{-- Content --}}
@if($activeTab === 'details')
{{-- Style/Colourway Selection --}}

Style & Colourway

@if($this->selectedColourway || $colourways_id) @php $cw = $this->selectedColourway; $sv = $cw?->style_versions; $st = $sv?->styles; $ds = $st?->designs; @endphp
{{ $ds?->id }} {{ $ds?->description }} {{ $cw?->name }}
@if($isNewSample) @endif
@else @error('colourways_id')
{{ $message }}
@enderror @endif

Sample Details

@error('sample_types_id')
{{ $message }}
@enderror
@error('sizes_id')
{{ $message }}
@enderror
@error('qty')
{{ $message }}
@enderror

Dates & Shipping

Notes & Charging

@elseif($activeTab === 'history')
@if($this->auditHistory->isEmpty())

No history available

History tracking was enabled in December 2023
@else @php $hasCreationRecord = $this->auditHistory->contains(fn($a) => $a->event === 'Created'); @endphp @if(!$hasCreationRecord)
This sample was created before history tracking was enabled (Dec 2023)
@endif
@foreach($this->auditHistory as $audit)
@if($audit->event === 'Created') @elseif($audit->event === 'Updated') @elseif($audit->event === 'Deleted') @else @endif
{{ $audit->model_type }} {{ $audit->event }} {{ $audit->user_name }} {{ $audit->created_at->diffForHumans() }}
@if(!empty($audit->changes))
@foreach($audit->changes as $change)
{{ $change['field'] }}: @if($audit->event !== 'Created') {{ $change['old'] }} @endif {{ $change['new'] }}
@endforeach
@endif
@endforeach
@endif
@endif
{{-- Footer --}}
@if(!$isNewSample) @endif
@endif
{{-- Style Picker Modal --}} @if($showStylePicker)

Select Style & Colourway

@forelse($this->availableStyles as $style)
{{ $style->designs?->id }} {{ $style->designs?->description }} @if($style->customer_ref) {{ $style->customer_ref }} @endif
@foreach($style->style_versions as $version) @foreach($version->colourways as $colourway) @endforeach @endforeach
@empty

Select a season or customer, or search to find styles

@endforelse
@endif