From c32dbb17ed3f4469baa113793a36d92d7520d1a0 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Fri, 2 Sep 2016 10:56:07 +0100 Subject: [PATCH] Added an additional theme - bootstrap3-light - that displays the default Bootstrap navbar (instead of the dark one) --- app/Providers/AppServiceProvider.php | 10 +++------- resources/views/themes/base/layout.blade.php | 14 ++++++++------ .../views/themes/base/partials/navbar.blade.php | 2 +- resources/views/themes/bootstrap3-light/theme.json | 7 +++++++ resources/views/themes/bootstrap3/theme.json | 3 ++- 5 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 resources/views/themes/bootstrap3-light/theme.json diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2a2bec1..f74bdd1 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -37,16 +37,12 @@ class AppServiceProvider extends ServiceProvider private function addThemeInfoToView() { $themeInfo = Theme::info(); - $themeInfoKeys = array('name', 'version'); - // Add each valid theme info element to the view - prefixing with theme_ + // Add each theme info element to the view - prefixing with theme_ // e.g. $themeInfo['name'] becomes $theme_name in the view - foreach ($themeInfoKeys as $key) + foreach ($themeInfo as $key => $value) { - if (isset($themeInfo[$key])) - { - View::share('theme_' . $key, $themeInfo[$key]); - } + View::share('theme_' . $key, $value); } // Also add a theme_url key diff --git a/resources/views/themes/base/layout.blade.php b/resources/views/themes/base/layout.blade.php index 4ec3888..56bd5e3 100644 --- a/resources/views/themes/base/layout.blade.php +++ b/resources/views/themes/base/layout.blade.php @@ -10,9 +10,10 @@ {{-- Cannot use $theme_url here: if a theme uses the base layout, it would also have to provide all these dependencies! --}} - - - + {{-- As these files are shipped with core (not a theme) use the main app.version instead of the current theme's version --}} + + + @stack('styles') @@ -23,9 +24,10 @@ {{-- Cannot use $theme_url here: if a theme uses the base layout, it would also have to provide all these dependencies! --}} - - - + {{-- As these files are shipped with core (not a theme) use the main app.version instead of the current theme's version --}} + + + @stack('scripts') diff --git a/resources/views/themes/base/partials/navbar.blade.php b/resources/views/themes/base/partials/navbar.blade.php index 1dd8463..421ce71 100644 --- a/resources/views/themes/base/partials/navbar.blade.php +++ b/resources/views/themes/base/partials/navbar.blade.php @@ -1,4 +1,4 @@ -