@extends('backend.layouts.app') @section('title', 'Theme Settings') @section('content') @php $pageTitle = 'Theme Settings'; $units = ['px', 'rem', '%', 'vh', 'vw']; @endphp

{{ $pageTitle }}

@csrf
{{-- ===== HARDCODED FIELDS ===== --}}

General Settings

{{-- Site Name --}}
{{-- Branding Images --}}

Branding Images

@php $brandFields = [ ['key' => 'sidebar_logo', 'label' => 'Sidebar Logo', 'desc' => 'Sidebar & navbar', 'imgClass' => 'h-14 rounded border border-gray-200 dark:border-gray-700 object-contain bg-white p-1', 'accept' => 'image/*', 'removeName' => 'remove_sidebar_logo', 'resetLabel' => 'Reset to default logo'], ['key' => 'favicon', 'label' => 'Favicon', 'desc' => 'Browser tab icon', 'imgClass' => 'w-8 h-8 rounded border border-gray-200 dark:border-gray-700 object-contain bg-white', 'accept' => 'image/*,.ico', 'removeName' => 'remove_favicon', 'resetLabel' => 'Reset to default favicon'], ['key' => 'login_logo', 'label' => 'Login Logo', 'desc' => 'Login page', 'imgClass' => 'h-14 rounded-xl border border-gray-200 dark:border-gray-700 object-contain bg-white p-1', 'accept' => 'image/*', 'removeName' => 'remove_login_logo', 'resetLabel' => 'Reset to default logo'], ['key' => 'login_background', 'label' => 'Login Background', 'desc' => 'Login page background', 'imgClass' => 'w-full h-20 rounded-xl border border-gray-200 dark:border-gray-700 object-cover', 'accept' => 'image/*', 'removeName' => 'remove_login_background', 'resetLabel' => 'Reset to default background'], ['key' => 'dashboard_banner', 'label' => 'Dashboard Banner', 'desc' => 'Dashboard banner', 'imgClass' => 'w-full h-20 rounded-xl border border-gray-200 dark:border-gray-700 object-cover', 'accept' => 'image/*', 'removeName' => 'remove_dashboard_banner', 'resetLabel' => 'Remove banner'], ]; @endphp
@foreach($brandFields as $f)
@if($hardcoded[$f['key']])
@if($f['key'] === 'favicon')
Favicon {{ basename($hardcoded['favicon']) }}
@else {{ $f['label'] }} @endif
@endif @if($f['key'] === 'dashboard_banner') @if($hardcoded['dashboard_banner'])
@endif @else
@endif
@endforeach
{{-- Sidebar Colors --}}

Sidebar Colors

@php $colorFields = [ ['name' => 'sidebar_bg_color', 'label' => 'Bg Light'], ['name' => 'sidebar_bg_color_dark', 'label' => 'Bg Dark'], ['name' => 'sidebar_text_color', 'label' => 'Text Light'], ['name' => 'sidebar_text_color_dark', 'label' => 'Text Dark'], ['name' => 'sidebar_active_bg_color', 'label' => 'Active Bg Light'], ['name' => 'sidebar_active_bg_color_dark', 'label' => 'Active Bg Dark'], ['name' => 'sidebar_active_text_color', 'label' => 'Active Text Light'], ['name' => 'sidebar_active_text_color_dark', 'label' => 'Active Text Dark'], ]; @endphp @foreach($colorFields as $cf)
{{ $hardcoded[$cf['name']] }}
@endforeach
{{-- ===== DYNAMIC RULES ===== --}} @foreach($rules as $rule) @php $ruleSettings = $settings[$rule->rule_id] ?? []; @endphp

{{ $rule->rule_name }}

@if($rule->rule_description)

{{ $rule->rule_description }}

@endif
@php $params = $rule->rule_params ?? []; @endphp @forelse($params as $param) @php $paramName = $param['param_name']; $paramType = $param['param_type'] ?? 'text'; $paramDefault = $param['param_default'] ?? ''; $currentValue = $ruleSettings[$paramName] ?? $paramDefault; @endphp
@php $def = $paramDefault; if ($paramType === 'unit') { if (is_object($paramDefault)) { $def = $paramDefault->value . $paramDefault->unit; } elseif (is_array($paramDefault)) { $def = ($paramDefault['value'] ?? '0') . ($paramDefault['unit'] ?? 'px'); } else { $def = $paramDefault . 'px'; } } @endphp @if($paramType === 'colorpicker') @elseif($paramType === 'unit') @php if (is_array($currentValue)) { $unitVal = $currentValue['value'] ?? '0'; $unitType = $currentValue['unit'] ?? 'px'; } elseif (is_object($currentValue)) { $unitVal = $currentValue->value ?? '0'; $unitType = $currentValue->unit ?? 'px'; } else { $unitVal = '0'; $unitType = 'px'; } @endphp
@else @endif @php $displayDefault = $paramDefault; if ($paramType === 'unit') { if (is_object($paramDefault)) { $displayDefault = $paramDefault->value . $paramDefault->unit; } elseif (is_array($paramDefault)) { $displayDefault = ($paramDefault['value'] ?? '0') . ($paramDefault['unit'] ?? 'px'); } else { $displayDefault = $paramDefault . 'px'; } } @endphp @if($displayDefault)

Default: {{ $displayDefault }}

@endif
@empty

No parameters defined for this rule.

@endforelse
@endforeach {{-- ===== SAVE BUTTON ===== --}}
Cancel
@endsection @push('scripts') @endpush