@extends('layouts.guest') @section('title', Session::get('lang', 'en') == 'en' ? 'Document - Brand Guidelines' : 'Dokumen - Brand Guidelines') @section('content')
@php $borderOpen = false; @endphp @forelse($layouts as $layout) {{-- SPECIAL HANDLING FOR DOWNLOAD LOGO --}} @if (isset($layout->card_type) && $layout->card_type === 'dwnldlogo') {{-- Open border if not already open --}} @if (!$borderOpen)
@php $borderOpen = true; $isFirstInBorder = true; @endphp @endif {{-- Add spacing for dwnldlogo if not first in border --}} @if ($borderOpen && !$isFirstInBorder)
@endif @php $isFirstInBorder = false; @endphp

{{ $layout->header }}

@if ($layout->description)

{!! $layout->description !!}

@endif
@if ($layout->documents->count() > 0)
@foreach ($layout->documents as $document)
{{ $document->header }}

{{ $document->header }}

@if ($document->description)
{!! $document->description !!}
@endif @php $downloadLinks = $document->links; $totalLinks = $downloadLinks->count(); @endphp
@endforeach
@else

@if (Session::get('lang', 'en') == 'en') No content available yet for this section. @else Belum ada konten tersedia untuk bagian ini. @endif

@endif
@else {{-- REGULAR LAYOUT HANDLING --}} @php $isInformational = in_array($layout->card_type, [ 'informational', 'info', 'info-r', 'info-rl', 'info-m', 'informational_right', 'informational_mixed', 'informational right', 'informational mixed', ]); $needsBorder = !$isInformational; @endphp {{-- Close border if moving from bordered to informational --}} @if ($borderOpen && $isInformational)
@php $borderOpen = false; @endphp @endif {{-- Open border if starting bordered section --}} @if ($needsBorder && !$borderOpen)
@php $borderOpen = true; $isFirstInBorder = true; @endphp @endif {{-- Informational without border --}} @if ($isInformational)
@endif
@php // Hide header dan description untuk cardtype informational dan dwnldsatu $hideHeader = in_array($layout->card_type, [ 'informational', 'info', 'info-r', 'info-rl', 'info-m', 'informational_right', 'informational_mixed', 'informational right', 'informational mixed', 'dwnldsatu', 'dwnlddua', ]); $headerStyle = $needsBorder ? 'margin-bottom: 25px; margin-top: 0; max-width: 100%; box-sizing: border-box;' : 'margin-bottom: 25px; margin-top: 20px; max-width: 100%; box-sizing: border-box;'; $descriptionStyle = 'margin-bottom: 35px; text-align: justify; max-width: 100%; box-sizing: border-box;'; @endphp {{-- Add spacing for bordered layouts (90px for 2nd+ layout in border) --}} @if ($needsBorder && $borderOpen && !$isFirstInBorder)
@endif @if ($needsBorder && $borderOpen) @php $isFirstInBorder = false; @endphp @endif @if (!$hideHeader)

{{ $layout->header }}

@if ($layout->description)

{!! $layout->description !!}

@endif @endif {{-- KONTEN --}} @if ($layout->documents->count() > 0) @php $cardsPerRow = $layout->number_of_card_per_row; $gridClass = 'one-column-grid'; // Untuk card type guideline, selalu gunakan 4 kolom if ($layout->card_type === 'guideline') { $gridClass = 'four-column-grid'; } else { if ($cardsPerRow == 2) { $gridClass = 'two-column-grid'; } if ($cardsPerRow == 3) { $gridClass = 'three-column-grid'; } if ($cardsPerRow == 4) { $gridClass = 'four-column-grid'; } } @endphp @else

@if (Session::get('lang', 'en') == 'en') No content available yet for this section. @else Belum ada konten tersedia untuk bagian ini. @endif

@endif
{{-- Close section for informational cards --}} @if ($isInformational)
@endif @endif {{-- End of @else regular layout handling --}} @empty {{-- kosongkan karena selalu ada layout --}} @endforelse {{-- Close border if still open at end --}} @if ($borderOpen)
@endif
@endsection