Included
* Standardised all six theme.json files to manifest version 2:
* admin
* common
* corporate
* saasland
* swiss
* welcome
* Every manifest now uses the same fields and structure.
* Separate active frontend and backend themes.
* One-click theme activation.
* Theme preview in a new browser tab without activating it.
* Theme cards showing:
* Preview
* Name
* Version
* Author
* Description
* Theme type
* Active status
* Dynamic theme-specific settings.
* Support for:
* Text
* URL
* Colour
* Textarea
* Checkbox fields
* Variants
* Appearance
* Accent palettes
* Theme ZIP installation.
* Theme ZIP export.
* Asset optimisation.
* Accessibility validation.
* Safe ZIP path validation.
* Theme inheritance.
* Active themes cannot be uninstalled.
* Parent themes cannot be uninstalled while child themes depend on them.
* Stylist administration routes now require an authenticated, verified user.
* Manifest validation now restricts theme types to:
* frontend
* backend
* common
* Added activation tests for independent frontend and backend theme selection.
The supplied corporate theme was incomplete, so I added the required backend entry view and placeholder asset files while preserving its supplied layout.
24 lines
1.1 KiB
PHP
24 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\Stylist\Http\Controllers;
|
|
|
|
use Illuminate\Routing\Controller;
|
|
use Modules\Stylist\Services\ThemeAccessibilityValidator;
|
|
use Modules\Stylist\Services\ThemeSettings;
|
|
use Modules\Stylist\Theme\Stylist;
|
|
use Modules\Stylist\Theme\UrlGenerator;
|
|
use Modules\Settings\Services\SettingsRepository;
|
|
|
|
final class StylistController extends Controller
|
|
{
|
|
public function __invoke(Stylist $stylist, ThemeSettings $settings, ThemeAccessibilityValidator $accessibility, UrlGenerator $urls, SettingsRepository $siteSettings)
|
|
{
|
|
return view('stylist::index', [
|
|
'theme' => $stylist->current(), 'themes' => $stylist->all(), 'variables' => $stylist->variables(),
|
|
'settingsService' => $settings, 'accessibility' => $accessibility, 'urls' => $urls,
|
|
'activeFrontendTheme' => $siteSettings->get('frontend_theme', config('stylist.default_frontend_theme', 'saasland'), 'site'),
|
|
'activeBackendTheme' => $siteSettings->get('backend_theme', config('stylist.default_backend_theme', 'admin'), 'site'),
|
|
]);
|
|
}
|
|
}
|