From c38cf8c1c4253ced315a22fa5c9fcaf00cda4a47 Mon Sep 17 00:00:00 2001 From: Virgil-Adrian Teaca Date: Wed, 23 May 2018 19:57:49 +0300 Subject: [PATCH] Implementation of the Assets Service --- app/Config/App.php | 12 ++------ app/Config/Auth.php | 6 ---- app/Config/Broadcasting.php | 1 + app/Config/Cache.php | 6 ---- app/Config/Database.php | 7 ----- app/Config/Dompdf.php | 1 + app/Config/FileField.php | 6 ---- app/Config/Languages.php | 7 ----- app/Config/Mail.php | 6 ---- app/Config/Packages.php | 1 + app/Config/Profiler.php | 6 ---- app/Config/Queue.php | 7 +---- app/Config/ReCaptcha.php | 6 ---- app/Config/Routing.php | 6 ---- app/Config/Session.php | 6 ---- app/Config/Validation.php | 1 + app/Config/View.php | 7 +---- app/Platform/Bootstrap.php | 2 +- app/Views/Layouts/Default.tpl | 30 +++++++++++++------ themes/AdminLite/Views/Layouts/Backend.php | 33 +++++++++++---------- themes/AdminLite/Views/Layouts/Default.php | 26 +++++++++------- themes/AdminLite/Views/Layouts/Frontend.php | 33 +++++++++++---------- 22 files changed, 80 insertions(+), 136 deletions(-) diff --git a/app/Config/App.php b/app/Config/App.php index b75b0e4991..2ccbc7c154 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -1,11 +1,4 @@ array( 'Nova\Foundation\Http\Middleware\CheckForMaintenanceMode', - 'Nova\Routing\Middleware\DispatchAssetFiles', + 'Nova\Assets\Middleware\DispatchAssetFiles', ), /** @@ -119,6 +112,7 @@ 'Nova\Auth\AuthServiceProvider', 'Nova\Bus\BusServiceProvider', 'Nova\Cache\CacheServiceProvider', + 'Nova\Assets\AssetServiceProvider', 'Nova\Routing\RoutingServiceProvider', 'Nova\Cookie\CookieServiceProvider', 'Nova\Packages\PackageServiceProvider', @@ -177,7 +171,6 @@ 'aliases' => array( // The Support Classes. 'Arr' => 'Nova\Support\Arr', - 'Assets' => 'Nova\Support\Assets', 'Str' => 'Nova\Support\Str', // The Database Seeder. @@ -185,6 +178,7 @@ // The Support Facades. 'App' => 'Nova\Support\Facades\App', + 'Asset' => 'Nova\Support\Facades\Asset', 'Auth' => 'Nova\Support\Facades\Auth', 'Broadcast' => 'Nova\Support\Facades\Broadcast', 'Bus' => 'Nova\Support\Facades\Bus', diff --git a/app/Config/Auth.php b/app/Config/Auth.php index ebcf9ab437..3ba347d657 100644 --- a/app/Config/Auth.php +++ b/app/Config/Auth.php @@ -1,10 +1,4 @@ {{ $title or 'Page' }} - {{ Config::get('app.name'); }} +@php - @assets('css', array( - 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', - 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css', - 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', - asset_url('css/bootstrap-xl-mod.min.css'), - asset_url('css/style.css'), - )) +echo Asset::build('css', array( + 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css', + 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css', + 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', + asset_url('css/bootstrap-xl-mod.min.css'), + asset_url('css/style.css'), +)); + +echo Asset::render('css', 'header'); +echo Asset::render('js', 'header'); + +@endphp @@ -28,10 +34,16 @@ @show -@assets('js', array( +@php + +echo Asset::build('js', array( 'https://code.jquery.com/jquery-1.12.4.min.js', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js' -)) +)); + +echo Asset::render('js', 'footer'); + +@endphp diff --git a/themes/AdminLite/Views/Layouts/Backend.php b/themes/AdminLite/Views/Layouts/Backend.php index 9759731fa8..1c8b8b81fb 100644 --- a/themes/AdminLite/Views/Layouts/Backend.php +++ b/themes/AdminLite/Views/Layouts/Backend.php @@ -24,8 +24,9 @@ - - - - + @@ -205,7 +205,8 @@ diff --git a/themes/AdminLite/Views/Layouts/Default.php b/themes/AdminLite/Views/Layouts/Default.php index 96c201217e..c5b7addf4a 100644 --- a/themes/AdminLite/Views/Layouts/Default.php +++ b/themes/AdminLite/Views/Layouts/Default.php @@ -21,8 +21,9 @@ - @@ -59,6 +54,14 @@ +
@@ -146,7 +149,8 @@ diff --git a/themes/AdminLite/Views/Layouts/Frontend.php b/themes/AdminLite/Views/Layouts/Frontend.php index 1f6f8dbfcd..8990bea265 100644 --- a/themes/AdminLite/Views/Layouts/Frontend.php +++ b/themes/AdminLite/Views/Layouts/Frontend.php @@ -24,8 +24,9 @@ - - - +
@@ -191,7 +191,8 @@