From c9c592b03328ab02376956ea8d9fa7dcca63b8bc Mon Sep 17 00:00:00 2001 From: James Brooks Date: Fri, 25 Nov 2016 20:19:38 +0000 Subject: [PATCH] Show an alert when ./bootstrap/cachet is not writeable. --- app/Composers/DashboardComposer.php | 1 + resources/lang/en/dashboard.php | 3 ++- resources/views/layout/dashboard.blade.php | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Composers/DashboardComposer.php b/app/Composers/DashboardComposer.php index e69a54f8..ea949b56 100644 --- a/app/Composers/DashboardComposer.php +++ b/app/Composers/DashboardComposer.php @@ -40,5 +40,6 @@ class DashboardComposer $view->withIncidentTemplateCount(IncidentTemplate::count()); $view->withScheduleCount(Schedule::count()); $view->withSubscriberCount(Subscriber::isVerified()->count()); + $view->withIsWriteable(is_writeable(app()->bootstrapPath().'/cachet')); } } diff --git a/resources/lang/en/dashboard.php b/resources/lang/en/dashboard.php index d019e51d..b4e2f6b2 100644 --- a/resources/lang/en/dashboard.php +++ b/resources/lang/en/dashboard.php @@ -11,7 +11,8 @@ return [ - 'dashboard' => 'Dashboard', + 'dashboard' => 'Dashboard', + 'writeable_settings' => 'The Cachet settings directory is not writeable. Please make sure that ./bootstrap/cachet is writeable by the web server.', // Incidents 'incidents' => [ diff --git a/resources/views/layout/dashboard.blade.php b/resources/views/layout/dashboard.blade.php index 81f87f4d..7a91a6cc 100644 --- a/resources/views/layout/dashboard.blade.php +++ b/resources/views/layout/dashboard.blade.php @@ -41,6 +41,18 @@
@include('dashboard.partials.sidebar')
+ @if(!$is_writeable) +
+
+
+
+ {!! trans('dashboard.writeable_settings') !!} +
+
+
+
+ @endif + @yield('content')