From 09cd7adb6bd7767aed8e738ca3595da567f92baa Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Fri, 22 May 2020 18:58:09 -0400 Subject: [PATCH] Apply theme globally; add mail templates into theme folder #715 --- app/Http/Kernel.php | 1 + app/Http/Middleware/SetActiveTheme.php | 17 +++++++++++++++++ app/Providers/RouteServiceProvider.php | 2 +- .../default}/vendor/mail/html/button.blade.php | 0 .../default}/vendor/mail/html/footer.blade.php | 0 .../default}/vendor/mail/html/header.blade.php | 0 .../default}/vendor/mail/html/layout.blade.php | 0 .../default}/vendor/mail/html/message.blade.php | 0 .../default}/vendor/mail/html/panel.blade.php | 0 .../vendor/mail/html/promotion.blade.php | 0 .../vendor/mail/html/promotion/button.blade.php | 0 .../default}/vendor/mail/html/subcopy.blade.php | 0 .../default}/vendor/mail/html/table.blade.php | 0 .../vendor/mail/html/themes/default.css | 0 .../vendor/mail/markdown/button.blade.php | 0 .../vendor/mail/markdown/footer.blade.php | 0 .../vendor/mail/markdown/header.blade.php | 0 .../vendor/mail/markdown/layout.blade.php | 0 .../vendor/mail/markdown/message.blade.php | 0 .../vendor/mail/markdown/panel.blade.php | 0 .../vendor/mail/markdown/promotion.blade.php | 0 .../mail/markdown/promotion/button.blade.php | 0 .../vendor/mail/markdown/subcopy.blade.php | 0 .../vendor/mail/markdown/table.blade.php | 0 .../default}/vendor/mail/text/button.blade.php | 0 .../default}/vendor/mail/text/footer.blade.php | 0 .../default}/vendor/mail/text/header.blade.php | 0 .../default}/vendor/mail/text/layout.blade.php | 0 .../default}/vendor/mail/text/message.blade.php | 0 .../default}/vendor/mail/text/panel.blade.php | 0 .../default}/vendor/mail/text/subcopy.blade.php | 0 .../default}/vendor/mail/text/table.blade.php | 0 32 files changed, 19 insertions(+), 1 deletion(-) rename resources/views/{ => layouts/default}/vendor/mail/html/button.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/footer.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/header.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/layout.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/message.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/panel.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/promotion.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/promotion/button.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/subcopy.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/table.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/html/themes/default.css (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/button.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/footer.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/header.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/layout.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/message.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/panel.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/promotion.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/promotion/button.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/subcopy.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/markdown/table.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/button.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/footer.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/header.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/layout.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/message.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/panel.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/subcopy.blade.php (100%) rename resources/views/{ => layouts/default}/vendor/mail/text/table.blade.php (100%) diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index c04016be..80d7d52d 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -45,6 +45,7 @@ class Kernel extends HttpKernel ShareErrorsFromSession::class, // VerifyCsrfToken::class, SubstituteBindings::class, + SetActiveTheme::class, ], ]; diff --git a/app/Http/Middleware/SetActiveTheme.php b/app/Http/Middleware/SetActiveTheme.php index c549fbd1..ec915ed1 100644 --- a/app/Http/Middleware/SetActiveTheme.php +++ b/app/Http/Middleware/SetActiveTheme.php @@ -15,6 +15,23 @@ class SetActiveTheme implements Middleware { public function handle(Request $request, Closure $next) { + $skip = [ + 'admin', + 'admin/*', + 'api', + 'api/*', + 'importer', + 'importer/*', + 'install', + 'install/*', + 'update', + 'update/*', + ]; + + if ($request->is($skip)) { + return $next($request); + } + try { $theme = setting('general.theme'); } catch (\Exception $e) { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index fc2d1076..5b0e642c 100755 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -39,7 +39,7 @@ class RouteServiceProvider extends ServiceProvider private function mapWebRoutes() { Route::group([ - 'middleware' => ['web', 'theme'], + 'middleware' => ['web'], 'namespace' => $this->namespace, ], function ($router) { Route::group([ diff --git a/resources/views/vendor/mail/html/button.blade.php b/resources/views/layouts/default/vendor/mail/html/button.blade.php similarity index 100% rename from resources/views/vendor/mail/html/button.blade.php rename to resources/views/layouts/default/vendor/mail/html/button.blade.php diff --git a/resources/views/vendor/mail/html/footer.blade.php b/resources/views/layouts/default/vendor/mail/html/footer.blade.php similarity index 100% rename from resources/views/vendor/mail/html/footer.blade.php rename to resources/views/layouts/default/vendor/mail/html/footer.blade.php diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/layouts/default/vendor/mail/html/header.blade.php similarity index 100% rename from resources/views/vendor/mail/html/header.blade.php rename to resources/views/layouts/default/vendor/mail/html/header.blade.php diff --git a/resources/views/vendor/mail/html/layout.blade.php b/resources/views/layouts/default/vendor/mail/html/layout.blade.php similarity index 100% rename from resources/views/vendor/mail/html/layout.blade.php rename to resources/views/layouts/default/vendor/mail/html/layout.blade.php diff --git a/resources/views/vendor/mail/html/message.blade.php b/resources/views/layouts/default/vendor/mail/html/message.blade.php similarity index 100% rename from resources/views/vendor/mail/html/message.blade.php rename to resources/views/layouts/default/vendor/mail/html/message.blade.php diff --git a/resources/views/vendor/mail/html/panel.blade.php b/resources/views/layouts/default/vendor/mail/html/panel.blade.php similarity index 100% rename from resources/views/vendor/mail/html/panel.blade.php rename to resources/views/layouts/default/vendor/mail/html/panel.blade.php diff --git a/resources/views/vendor/mail/html/promotion.blade.php b/resources/views/layouts/default/vendor/mail/html/promotion.blade.php similarity index 100% rename from resources/views/vendor/mail/html/promotion.blade.php rename to resources/views/layouts/default/vendor/mail/html/promotion.blade.php diff --git a/resources/views/vendor/mail/html/promotion/button.blade.php b/resources/views/layouts/default/vendor/mail/html/promotion/button.blade.php similarity index 100% rename from resources/views/vendor/mail/html/promotion/button.blade.php rename to resources/views/layouts/default/vendor/mail/html/promotion/button.blade.php diff --git a/resources/views/vendor/mail/html/subcopy.blade.php b/resources/views/layouts/default/vendor/mail/html/subcopy.blade.php similarity index 100% rename from resources/views/vendor/mail/html/subcopy.blade.php rename to resources/views/layouts/default/vendor/mail/html/subcopy.blade.php diff --git a/resources/views/vendor/mail/html/table.blade.php b/resources/views/layouts/default/vendor/mail/html/table.blade.php similarity index 100% rename from resources/views/vendor/mail/html/table.blade.php rename to resources/views/layouts/default/vendor/mail/html/table.blade.php diff --git a/resources/views/vendor/mail/html/themes/default.css b/resources/views/layouts/default/vendor/mail/html/themes/default.css similarity index 100% rename from resources/views/vendor/mail/html/themes/default.css rename to resources/views/layouts/default/vendor/mail/html/themes/default.css diff --git a/resources/views/vendor/mail/markdown/button.blade.php b/resources/views/layouts/default/vendor/mail/markdown/button.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/button.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/button.blade.php diff --git a/resources/views/vendor/mail/markdown/footer.blade.php b/resources/views/layouts/default/vendor/mail/markdown/footer.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/footer.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/footer.blade.php diff --git a/resources/views/vendor/mail/markdown/header.blade.php b/resources/views/layouts/default/vendor/mail/markdown/header.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/header.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/header.blade.php diff --git a/resources/views/vendor/mail/markdown/layout.blade.php b/resources/views/layouts/default/vendor/mail/markdown/layout.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/layout.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/layout.blade.php diff --git a/resources/views/vendor/mail/markdown/message.blade.php b/resources/views/layouts/default/vendor/mail/markdown/message.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/message.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/message.blade.php diff --git a/resources/views/vendor/mail/markdown/panel.blade.php b/resources/views/layouts/default/vendor/mail/markdown/panel.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/panel.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/panel.blade.php diff --git a/resources/views/vendor/mail/markdown/promotion.blade.php b/resources/views/layouts/default/vendor/mail/markdown/promotion.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/promotion.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/promotion.blade.php diff --git a/resources/views/vendor/mail/markdown/promotion/button.blade.php b/resources/views/layouts/default/vendor/mail/markdown/promotion/button.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/promotion/button.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/promotion/button.blade.php diff --git a/resources/views/vendor/mail/markdown/subcopy.blade.php b/resources/views/layouts/default/vendor/mail/markdown/subcopy.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/subcopy.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/subcopy.blade.php diff --git a/resources/views/vendor/mail/markdown/table.blade.php b/resources/views/layouts/default/vendor/mail/markdown/table.blade.php similarity index 100% rename from resources/views/vendor/mail/markdown/table.blade.php rename to resources/views/layouts/default/vendor/mail/markdown/table.blade.php diff --git a/resources/views/vendor/mail/text/button.blade.php b/resources/views/layouts/default/vendor/mail/text/button.blade.php similarity index 100% rename from resources/views/vendor/mail/text/button.blade.php rename to resources/views/layouts/default/vendor/mail/text/button.blade.php diff --git a/resources/views/vendor/mail/text/footer.blade.php b/resources/views/layouts/default/vendor/mail/text/footer.blade.php similarity index 100% rename from resources/views/vendor/mail/text/footer.blade.php rename to resources/views/layouts/default/vendor/mail/text/footer.blade.php diff --git a/resources/views/vendor/mail/text/header.blade.php b/resources/views/layouts/default/vendor/mail/text/header.blade.php similarity index 100% rename from resources/views/vendor/mail/text/header.blade.php rename to resources/views/layouts/default/vendor/mail/text/header.blade.php diff --git a/resources/views/vendor/mail/text/layout.blade.php b/resources/views/layouts/default/vendor/mail/text/layout.blade.php similarity index 100% rename from resources/views/vendor/mail/text/layout.blade.php rename to resources/views/layouts/default/vendor/mail/text/layout.blade.php diff --git a/resources/views/vendor/mail/text/message.blade.php b/resources/views/layouts/default/vendor/mail/text/message.blade.php similarity index 100% rename from resources/views/vendor/mail/text/message.blade.php rename to resources/views/layouts/default/vendor/mail/text/message.blade.php diff --git a/resources/views/vendor/mail/text/panel.blade.php b/resources/views/layouts/default/vendor/mail/text/panel.blade.php similarity index 100% rename from resources/views/vendor/mail/text/panel.blade.php rename to resources/views/layouts/default/vendor/mail/text/panel.blade.php diff --git a/resources/views/vendor/mail/text/subcopy.blade.php b/resources/views/layouts/default/vendor/mail/text/subcopy.blade.php similarity index 100% rename from resources/views/vendor/mail/text/subcopy.blade.php rename to resources/views/layouts/default/vendor/mail/text/subcopy.blade.php diff --git a/resources/views/vendor/mail/text/table.blade.php b/resources/views/layouts/default/vendor/mail/text/table.blade.php similarity index 100% rename from resources/views/vendor/mail/text/table.blade.php rename to resources/views/layouts/default/vendor/mail/text/table.blade.php