@extends('layouts.master') @section('title', ($policy->meta_title ?: $policy->title) . ' | ' . setting('site.title', 'Farmers for Forests')) @if($policy->meta_description) @section('meta_description', $policy->meta_description) @endif @php if (!function_exists('renderPolicyIconClass')) { function renderPolicyIconClass($iconStr, $fallback = 'fa fa-leaf') { if (empty($iconStr)) return $fallback; $iconStr = trim((string)$iconStr); // Already formatted CSS classes if (str_starts_with($iconStr, 'ri-') || str_contains($iconStr, ' ri-')) { return $iconStr; } if (str_starts_with($iconStr, 'bi-') || str_starts_with($iconStr, 'bi ') || str_contains($iconStr, ' bi-')) { return str_starts_with($iconStr, 'bi ') ? $iconStr : 'bi bi-' . preg_replace('/^bi-/', '', $iconStr); } if (str_starts_with($iconStr, 'fa-solid ') || str_starts_with($iconStr, 'fa-regular ') || str_starts_with($iconStr, 'fa-brands ') || str_starts_with($iconStr, 'fas ') || str_starts_with($iconStr, 'far ') || str_starts_with($iconStr, 'fab ') || str_starts_with($iconStr, 'fa ')) { return $iconStr; } // React Icon PascalCase mapping if (preg_match('/^Ri([A-Z].*)$/', $iconStr, $m)) { $kebab = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1-$2', $m[1])); return 'ri-' . $kebab; } if (preg_match('/^Bs([A-Z].*)$/', $iconStr, $m)) { $kebab = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1-$2', $m[1])); return 'bi bi-' . $kebab; } if (preg_match('/^Fa([A-Z].*)$/', $iconStr, $m)) { $kebab = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1-$2', $m[1])); return 'fa-solid fa-' . $kebab; } if (preg_match('/^Lu([A-Z].*)$/', $iconStr, $m)) { $kebab = strtolower(preg_replace('/([a-z0-9])([A-Z])/', '$1-$2', $m[1])); return 'ri-' . $kebab; } if (str_starts_with($iconStr, 'fa-')) { return 'fa ' . $iconStr; } return 'fa fa-' . $iconStr; } } @endphp @push('custom-css') @endpush @section('content')

{{ $policy->title }}

Farmers for Forests > {{ $policy->badge_text ?: 'Legal & Governance' }}
@if(!empty($policy->effective_date))
Effective Date: {{ $policy->effective_date }}
@endif
@if($allPolicies->count() > 1)
@endif @if(is_array($policy->sections) && count($policy->sections) > 0) @endif
@if($policy->hero_summary)
{!! nl2br(e($policy->hero_summary)) !!}
@endif
@forelse($policy->sections ?? [] as $sIdx => $sec) @php $secNum = $sec['number'] ?? sprintf('%02d', $sIdx + 1); $secIcon = $sec['icon'] ?? 'fa-leaf'; $secTitle = $sec['title'] ?? 'Section ' . $secNum; $secId = !empty($sec['id']) ? $sec['id'] : 'sec-' . $secNum; $blocks = $sec['blocks'] ?? []; @endphp

{{ ltrim($secNum, '0') }}. {{ $secTitle }}

@forelse($blocks as $bIdx => $block) @php $bType = $block['type'] ?? 'text'; @endphp {{-- 1. Plain / Rich Text Block --}} @if($bType === 'text')
{!! $block['content'] ?? $block['text'] ?? '' !!}
{{-- 2. 4-Card Grid Block --}} @elseif($bType === 'cards') @php $cards = $block['cards'] ?? $block['items'] ?? []; @endphp
@foreach($cards as $card) @php $cardDesc = $card['desc'] ?? $card['description'] ?? ''; @endphp
@if(!empty($card['badge'])) {{ $card['badge'] }} @endif

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

@if(!empty($cardDesc))

{!! nl2br(e($cardDesc)) !!}

@endif
@endforeach
{{-- 3. Data Table Block --}} @elseif($bType === 'table') @php $headers = $block['headers'] ?? []; $rows = $block['rows'] ?? []; @endphp
@if(count($headers) > 0) @foreach($headers as $h) @endforeach @endif @foreach($rows as $row) @foreach($row as $cell) @endforeach @endforeach
{{ $h }}
{!! nl2br(e($cell)) !!}
{{-- 4. Callout / Notice Block --}} @elseif($bType === 'callout') @php $tone = $block['tone'] ?? 'info'; $cIcon = !empty($block['icon']) ? $block['icon'] : match($tone) { 'warning' => 'fa-triangle-exclamation', 'success' => 'fa-circle-check', 'danger' => 'fa-shield-exclamation', default => 'fa-circle-info', }; @endphp
@if(!empty($block['title']))

{{ $block['title'] }}

@endif

{!! nl2br(e($block['message'] ?? $block['text'] ?? '')) !!}

{{-- 5. Policy Hero Card Block --}} @elseif($bType === 'hero_card') @php $rawHl = $block['highlights'] ?? $block['items'] ?? []; $hlList = is_array($rawHl) ? $rawHl : (is_string($rawHl) ? explode("\n", $rawHl) : []); $heroSummary = $block['summary'] ?? $block['subtitle'] ?? ''; @endphp
@if(!empty($block['badge'])) {{ $block['badge'] }} @endif @if(!empty($block['title']))

{{ $block['title'] }}

@endif @if(!empty($heroSummary))

{{ $heroSummary }}

@endif @if(count($hlList) > 0)
    @foreach($hlList as $hl) @if(trim($hl))
  • {{ trim($hl) }}
  • @endif @endforeach
@endif
{{-- 6. Custom Block --}} @elseif($bType === 'custom')
@if(!empty($block['heading']) || !empty($block['title']))

{{ $block['heading'] ?? $block['title'] }}

@endif {!! $block['custom_html'] ?? $block['content'] ?? '' !!}
@endif @empty

No content blocks available for this section.

@endforelse
@empty

No Sections Published Yet

This policy is currently being updated by the compliance team.

@endforelse

Have Questions?

Reach out to our Grievance Redressal Officer directly, or submit an inquiry through our dedicated form.

Inquiry Form
@if(is_array($policy->sections) && count($policy->sections) > 0) @endif @endsection @push('custom-js-scripts') @endpush