Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Feb 28, 2024
1 parent ba287a3 commit 022dd2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 115 deletions.
8 changes: 4 additions & 4 deletions config/playground-blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'bootstrap-dark' => [
'bsTheme' => 'dark',
'editor' => '/vendor/ckeditor-bootstrap.css',
'enable' => (bool) env('PLAYGROUND_BLADE_THEME_LIGHT_ENABLE', true),
'enable' => false,
'label' => 'CkEditor Unified Bootstrap Theme under Dark',
'key' => 'bootstrap-dark',
'icon' => 'fa-brands fa-bootstrap',
Expand All @@ -54,7 +54,7 @@
'bootstrap-light' => [
'bsTheme' => 'light',
'editor' => '/vendor/ckeditor-bootstrap.css',
'enable' => true,
'enable' => false,
'label' => 'CkEditor Unified Bootstrap Theme under Light',
'key' => 'bootstrap-light',
'icon' => 'fa-brands fa-bootstrap',
Expand All @@ -64,7 +64,7 @@
'lark-dark' => [
'bsTheme' => 'dark',
'editor' => '/vendor/ckeditor-lark.css',
'enable' => true,
'enable' => false,
'label' => 'CkEditor Lark Theme under Dark',
'key' => 'lark-dark',
'icon' => 'fa-solid fa-dove fa-moon',
Expand All @@ -74,7 +74,7 @@
'lark-light' => [
'bsTheme' => 'light',
'editor' => '/vendor/ckeditor-lark.css',
'enable' => true,
'enable' => false,
'label' => 'CkEditor Lark Theme under Light',
'key' => 'lark-light',
'icon' => 'fa-solid fa-dove fa-sun',
Expand Down
94 changes: 1 addition & 93 deletions resources/views/layouts/bootstrap.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!doctype html>
<?php
/**
* @var array<string, mixed> $package_config
*/
Expand All @@ -15,28 +14,8 @@
* @var \Playground\Blade\Themes\Theme|\Playground\Blade\Themes\Bootstrap
*/
$theme = Playground\Blade\Facades\Ui::theme();
$ckTheme = $theme->editor();
// dd([
// '__FILE__' => __FILE__,
// '$ckTheme' => $ckTheme,
// '$theme' => $theme,
// ]);
/**
* @var string $appTheme The application theme.
*/
// $appTheme = isset($appTheme) && is_string($appTheme) && !empty($appTheme) ? $appTheme : session('appTheme');
// $appTheme = is_string($appTheme) ? trim($appTheme) : '';
// $ckTheme = $appTheme;
// if (str_contains($appTheme, ' ')) {
// $appTheme = Illuminate\Support\Str::of($appTheme)->before(' ')->toString();
// }
?>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" data-bs-theme="{{ $theme->bsTheme() }}">
{{-- <html lang="{{ str_replace('_', '-', app()->getLocale()) }}" data-bs-theme="{{ $appTheme }}"> --}}
<?php
/**
* @var string $appName The application name.
Expand Down Expand Up @@ -119,64 +98,6 @@
$withVue = isset($withVue) && is_bool($withVue) ? $withVue : true;
$withPlayground = isset($withPlayground) && is_bool($withPlayground) ? $withPlayground : true;
// /**
// * @var array<string, array<string, mixed>> $libs The view library asset information.
// */
// $libs = !empty($package_config['libs']) && is_array($package_config['libs']) ? $package_config['libs'] : [];
// /**
// * @var array<string> The order matters for the rendering of scripts.
// */
// $scriptListHead = [];
// $scriptListBody = [];
// if ($withScripts) {
// $scriptListBody[] = 'moment';
// $scriptListBody[] = 'bootstrap';
// $scriptListHead[] = 'bootstrap-css';
// if ($withEditor) {
// $scriptListHead[] = 'ckeditor';
// }
// if ($withPlayground) {
// $scriptListBody[] = 'playground';
// }
// $scriptListBody[] = 'jquery';
// $scriptListBody[] = 'popper';
// if ($withIcons) {
// $scriptListHead[] = 'fontawesome-css';
// $scriptListBody[] = 'fontawesome';
// }
// if ($withVue) {
// $scriptListHead[] = 'vue';
// }
// if (!empty($libs['head']) && is_array($libs['head'])) {
// foreach ($libs['head'] as $key => $libs_head_meta) {
// if (is_array($libs_head_meta) && !empty($libs_head_meta['always']) && !in_array($key, $scriptListHead)) {
// $scriptListHead[] = $key;
// }
// }
// }
// if (!empty($libs['body']) && is_array($libs['body'])) {
// foreach ($libs['body'] as $key => $libs_body_meta) {
// if (is_array($libs_body_meta) && !empty($libs_body_meta['always']) && !in_array($key, $scriptListBody)) {
// $scriptListBody[] = $key;
// }
// }
// }
// }
// dump([
// '__FILE__' => __FILE__,
// // '$scriptListHead' => $scriptListHead,
// // '$scriptListBody' => $scriptListBody,
// // '$libs' => $libs,
// '$theme' => $theme,
// ]);
?>

<head>
Expand All @@ -189,18 +110,12 @@
@foreach (Playground\Blade\Facades\Ui::headAssets() as $asset)
{!! $asset !!}
@endforeach
{{-- @if (!empty($libs['head']) && is_array($libs['head']))
@include(sprintf('%1$slayouts/bootstrap/libraries', $package_config['view']), [
'libs' => $libs['head'],
'required' => $scriptListHead,
])
@endif --}}

@stack('scripts')
@yield('head')

@if (!empty($theme->editor()))
<link rel="stylesheet" href="{{$theme->editor()}}" type="text/css">
<link rel="stylesheet" href="{{ $theme->editor() }}" type="text/css">
@endif

@if (!$withBreadcrumbs)
Expand Down Expand Up @@ -273,13 +188,6 @@
{!! $asset !!}
@endforeach

{{-- @if (!empty($libs['head']) && is_array($libs['body']))
@include(sprintf('%1$slayouts/bootstrap/libraries', $package_config['view']), [
'libs' => $libs['body'],
'required' => $scriptListBody,
])
@endif --}}

</body>

</html>
17 changes: 0 additions & 17 deletions resources/views/layouts/bootstrap/libraries.blade.php

This file was deleted.

2 changes: 1 addition & 1 deletion resources/views/layouts/bootstrap/nav.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<hr class="dropdown-divider">
</li>
<li>
<p class="ms-3 text-info">
<p class="ms-3 my-1 text-info">
Themes
</p>
</li>
Expand Down

0 comments on commit 022dd2a

Please sign in to comment.