@php
// Get data from controller - fallback to defaults if not provided
$templates = $templates ?? collect();
$sections = $sections ?? collect();
$current_template_id = $current_template_id ?? session('selected_template_id');
$current_section_id = $current_section_id ?? session('selected_section_id');
$current_template = $current_template ?? null;
$current_section = $current_section ?? null;
$template_permissions = \App\Models\Masters\Permission::checkModulePermissions(['index', 'create'], 'ReportTemplateController');
$template_service_permissions = \App\Models\Masters\Permission::checkModulePermissions(['index', 'create', 'edit', 'destroy', 'show'], 'ReportTemplateServiceController');
@endphp
@if(!session('tenant_id'))
@else
@endif
@if($template_service_permissions['create'])
@endif
@php
$templateClassName = \App\Helpers\Helper::getController();
@endphp
@if(!isset($dontShowNotSection))
@if($current_section_id)
@else
There is no section selected yet.
@endif
@endif
@if(!$current_section_id && session('tenant_id'))
@endif