@extends('layouts.app') @section('content')

{{ $isNewTheme ? 'Create New Theme' : 'Edit Theme: ' . $theme->name }}

{{ $isNewTheme ? 'Design a new theme using Builder V2' : 'Update theme settings and components' }}

Back to Themes
@csrf
Theme Information
Enter a unique, descriptive name for your theme
Describe what makes this theme unique
Or enter an image URL: @if(!empty($theme->preview_image ?? ''))
Preview
@endif
is_premium ?? false) ? 'checked' : '' }}>
@php $industryOptions = ['agency', 'portfolio', 'creative', 'design', 'photography', 'startup', 'corporate', 'ecommerce', 'blog', 'restaurant', 'healthcare', 'education', 'real-estate']; $selectedIndustries = $theme->industries ?? []; @endphp @foreach($industryOptions as $industry)
@endforeach
Select applicable industries
@php $featureOptions = ['responsive', 'dark_mode_ready', 'animations', 'ecommerce_ready', 'builder_v2_compatible', 'rtl_support', 'seo_optimized', 'accessibility']; $selectedFeatures = $theme->features ?? []; @endphp @foreach($featureOptions as $feature)
@endforeach
Select theme features
Theme Design
@if($isNewTheme)
How to create theme components:
  1. Create pages in Builder V2 with your desired header, footer, and section designs
  2. Return here and click "Import from Builder V2 Page"
  3. Select the page you designed
  4. System will extract components and save them as theme templates
@else
Theme Components ({{ $theme->components_count ?? 0 }})
@if($theme && $theme->components->count() > 0)
@foreach($theme->components as $component)
{{ $component->name }} {{ $component->type }} @if($component->is_required) Required @endif
@if($component->description) {{ $component->description }} @endif
@endforeach
@else

No components yet. Import from a Builder V2 page to get started.

@endif
@endif
Universal Components Library

Pre-built components available for use in your theme. These are universal components that can be used across all themes.

@php $universalComponents = \App\Models\ThemeComponent::whereNull('theme_id') ->orderBy('type') ->orderBy('order') ->get() ->groupBy('type'); @endphp @if($universalComponents->count() > 0)
@foreach($universalComponents as $type => $components)
@foreach($components as $component)
{{ $component->name }}
{{ ucfirst($type) }}
@if($component->description)

{{ $component->description }}

@endif
@if($component->variables && count($component->variables) > 0)
{{ count($component->variables) }} customizable variables
@endif
@endforeach
@endforeach
@else
No universal components available. Run the ThemeComponentsSeeder to add pre-built E-commerce, Booking, and Payment components.
@endif
Color & Font Presets
@if(!$isNewTheme && $theme && $theme->presets->count() > 0)
@foreach($theme->presets as $preset)
{{ $preset->name }} @if($preset->is_default) Default @endif
@if($preset->description)

{{ $preset->description }}

@endif @if($preset->color_scheme)
@foreach($preset->color_scheme as $key => $color) @php $colorValue = is_array($color) ? ($color['default'] ?? $color[0] ?? '#cccccc') : $color; @endphp
{{ ucfirst($key) }}
@endforeach
@endif @if($preset->font_scheme) @php $headingFont = $preset->font_scheme['heading'] ?? 'Default'; $bodyFont = $preset->font_scheme['body'] ?? 'Default'; $headingFont = is_array($headingFont) ? ($headingFont['default'] ?? 'Default') : $headingFont; $bodyFont = is_array($bodyFont) ? ($bodyFont['default'] ?? 'Default') : $bodyFont; @endphp Fonts: {{ $headingFont }} (heading), {{ $bodyFont }} (body) @endif
@endforeach
@endif @if($isNewTheme)

Create at least one preset with colors and fonts for your theme

@endif
Theme Pages
@if(!$isNewTheme && $theme && $theme->pages->count() > 0)
@foreach($theme->pages->sortBy('order') as $page)
{{ $page->title }} {{ $page->getPageTypeLabel() }} @if($page->page_type === 'home') Home Page @endif @if(in_array($page->page_type, ['header', 'footer'])) Global Section @endif @if($page->is_required) Required @endif @if(!$page->is_published) Draft @endif
@if(in_array($page->page_type, ['header', 'footer'])) Appears on all pages @else {{ $page->slug }} @endif
@if($page->description)

{{ $page->description }}

@endif
@if($page->page_type !== 'home' && !in_array($page->page_type, ['header', 'footer'])) @endif
@endforeach
@else
No pages yet! Add complete page templates that will be auto-created when users install this theme.
Pages are like WordPress/Shopify themes - users get ready-made pages (Home, About, Contact, etc.) that they can customize.
@endif @if($isNewTheme)

Save your theme first, then you can add pre-designed pages

@endif
@if(!$isNewTheme && $theme)
Version History
@if($theme->versions->count() > 0)
@foreach($theme->versions()->latest()->take(5)->get() as $version)
v{{ $version->version }} @if($version->is_published) Published @else Draft @endif
{{ $version->created_at->format('M d, Y H:i') }} @if($version->creator) by {{ $version->creator->name }} @endif
@if($version->changelog)
{{ $version->changelog }}
@endif
@if(!$version->is_published) @endif
@endforeach
@else

No version history yet. Create a version to track changes.

@endif

Creating versions helps track changes and allows users to see what's new in theme updates

@endif
@if(!$isNewTheme) @endif
Cancel
@push('scripts') ${JSON.stringify(component.variables, null, 2)} `.trim(); navigator.clipboard.writeText(allCode).then(() => { alert('Code copied to clipboard!'); }).catch(err => { console.error('Failed to copy:', err); alert('Failed to copy code to clipboard'); }); } }); } // Initialize tooltips for universal components document.addEventListener('DOMContentLoaded', function() { const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl); }); }); @endpush @endsection