@extends('layouts.app', ['locale' => $locale, 'localeSettings' => $localeSettings, 'page' => $page]) @section('content') @php($sections = collect($translation->sections ?? [])->keyBy('key')) @php($url = fn (string $path): string => route($path, ['locale' => $locale]))
@foreach (['traceability.hero', 'traceability.intro', 'traceability.stages', 'traceability.cultivation', 'traceability.value-creation', 'traceability.principles', 'traceability.cta'] as $key) @php($section = $sections->get($key)) @php($data = $section['data'] ?? []) @if ($key === 'traceability.hero')
@if($asset=$media[$data['media_asset_id'] ?? null] ?? null){{ $asset->translation($locale)?->alt_text ?? '' }}@endif

{{ $data['eyebrow'] ?? '' }}

{{ $data['title'] ?? '' }}

{{ $data['summary'] ?? '' }}

@can('update', $page)@endcan
@elseif ($key === 'traceability.intro')

{{ $data['eyebrow'] ?? '' }}

{{ $data['title'] ?? '' }}

{{ $data['first_paragraph'] ?? '' }}

{{ $data['second_paragraph'] ?? '' }}

@if($asset=$media[$data['media_asset_id'] ?? null] ?? null){{ $asset->translation($locale)?->alt_text ?? '' }}@endif
@can('update', $page)@endcan
@elseif ($key === 'traceability.stages')

{{ $data['eyebrow'] ?? '' }}

{{ $data['title'] ?? '' }}

{{ $data['summary'] ?? '' }}

    @foreach($data['items'] ?? [] as $index => $item)
  1. {{ str_pad((string)($index + 1), 2, '0', STR_PAD_LEFT) }}

    {{ $item['title'] ?? '' }}

    {{ $item['body'] ?? '' }}

  2. @endforeach
@can('update', $page)@endcan
@elseif (in_array($key, ['traceability.cultivation', 'traceability.value-creation'], true))
@if($asset=$media[$data['media_asset_id'] ?? null] ?? null){{ $asset->translation($locale)?->alt_text ?? '' }}@endif

{{ $data['eyebrow'] ?? '' }}

{{ $data['title'] ?? '' }}

{{ $data['first_paragraph'] ?? '' }}

{{ $data['second_paragraph'] ?? '' }}

@if(!empty($data['cta_label']) && !empty($data['cta_path'])){{ $data['cta_label'] }} @endif
@can('update', $page)@endcan
@elseif ($key === 'traceability.principles')

{{ $data['eyebrow'] ?? '' }}

{{ $data['title'] ?? '' }}

@foreach($data['items'] ?? [] as $item)

{{ $item['title'] ?? '' }}

{{ $item['body'] ?? '' }}

@endforeach
@can('update', $page)@endcan
@else

{{ $data['eyebrow'] ?? '' }}

{{ $data['title'] ?? '' }}

{{ $data['summary'] ?? '' }}

@can('update', $page)@endcan
@endif @endforeach
@endsection