@extends('backend.layouts.app') @section('title', 'Theme Settings') @push('styles') @endpush @section('content') @include('backend.module._index-reset-button') @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', 'size' => '400 × 130px', 'cropWidth' => 400, 'cropHeight' => 130, 'acceptedTypes' => ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml'], 'imgClass' => 'h-14 rounded border border-gray-200 dark:border-gray-700 object-contain bg-white p-1', 'accept' => 'image/jpeg,image/png,image/webp,image/svg+xml', 'removeName' => 'remove_sidebar_logo', 'resetLabel' => 'Reset to default logo', 'icon' => 'sidebar'], ['key' => 'favicon', 'label' => 'Favicon', 'desc' => 'Browser tab icon', 'size' => '64 × 64px', 'cropWidth' => 64, 'cropHeight' => 64, 'acceptedTypes' => ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml', 'image/x-icon', 'image/vnd.microsoft.icon'], 'imgClass' => 'w-8 h-8 rounded border border-gray-200 dark:border-gray-700 object-contain bg-white', 'accept' => 'image/jpeg,image/png,image/webp,image/svg+xml,image/x-icon,image/vnd.microsoft.icon', 'removeName' => 'remove_favicon', 'resetLabel' => 'Remove favicon', 'icon' => 'browser'], ['key' => 'login_logo', 'label' => 'Login Logo', 'desc' => 'Login page', 'size' => '224 × 224px', 'cropWidth' => 224, 'cropHeight' => 224, 'acceptedTypes' => ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml'], 'imgClass' => 'h-14 rounded-xl border border-gray-200 dark:border-gray-700 object-contain bg-white p-1', 'accept' => 'image/jpeg,image/png,image/webp,image/svg+xml', 'removeName' => 'remove_login_logo', 'resetLabel' => 'Reset to default logo', 'icon' => 'lock'], ['key' => 'login_background', 'label' => 'Login Background', 'desc' => 'Login page background', 'size' => '1920 × 1080px', 'cropWidth' => 1920, 'cropHeight' => 1080, 'acceptedTypes' => ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml'], 'imgClass' => 'w-full h-20 rounded-xl border border-gray-200 dark:border-gray-700 object-cover', 'accept' => 'image/jpeg,image/png,image/webp,image/svg+xml', 'removeName' => 'remove_login_background', 'resetLabel' => 'Reset to default background', 'icon' => 'image'], ['key' => 'dashboard_banner', 'label' => 'Dashboard Banner', 'desc' => 'Dashboard banner', 'size' => '1920 × 400px', 'cropWidth' => 1920, 'cropHeight' => 400, 'acceptedTypes' => ['image/jpeg', 'image/png', 'image/webp', 'image/svg+xml'], 'imgClass' => 'w-full h-20 rounded-xl border border-gray-200 dark:border-gray-700 object-cover', 'accept' => 'image/jpeg,image/png,image/webp,image/svg+xml', 'removeName' => 'remove_dashboard_banner', 'resetLabel' => 'Remove banner', 'icon' => 'chart'], ]; $brandIcons = [ 'sidebar' => '', 'browser' => '', 'lock' => '', 'image' => '', 'chart' => '', ]; @endphp
@foreach($brandFields as $f)
{{-- Left: Info --}}
{!! $brandIcons[$f['icon']] !!}
{{ $f['label'] }} {{ $f['desc'] }}
{{ $f['size'] }}
{{-- Right: Preview + Upload --}}
{{-- Preview --}} @if($hardcoded[$f['key']])
{{ $f['label'] }}
@endif {{-- Upload + Reset --}}
@include('backend.layouts.partials._upload-hint', ['text' => 'Recommended ' . $f['size'] . ' · ' . ($f['key'] === 'favicon' ? 'ICO, PNG, SVG, JPG, WebP' : 'PNG, SVG, JPG, WebP') . ' · Max 15MB'])

Raster images can be cropped to {{ $f['size'] }}. SVG{{ $f['key'] === 'favicon' ? ' and ICO' : '' }} files are uploaded as-is.

@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 $paramLabel = \Illuminate\Support\Str::headline($paramName); $paramDescriptions = [ 'background-gradient' => 'CSS gradient used behind the login background image, e.g. linear-gradient(45deg, #0598ff, #09d19a).', 'title' => 'Welcome heading displayed on the login page.', 'description' => 'Welcome paragraph displayed under the login heading.', 'copyright' => 'Copyright line displayed at the bottom of the login page.', ]; $paramDescription = $paramDescriptions[$paramName] ?? 'Value for the {{' . $paramName . '}} token in the CSS template below.'; @endphp

{{ $paramDescription }}

@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