diff --git a/app/Composers/AppComposer.php b/app/Composers/AppComposer.php index c9b4122cfe1c..f1f48d011a67 100644 --- a/app/Composers/AppComposer.php +++ b/app/Composers/AppComposer.php @@ -78,5 +78,6 @@ public function compose(View $view) $view->withTimezone($this->dates->getTimezone()); $view->withSiteTitle($this->config->get('setting.app_name')); $view->withFontSubset($this->config->get('langs.'.$this->config->get('app.locale').'.subset', 'latin')); + $view->withOnlyDisruptedDays($this->config->get('setting.only_disrupted_days')); } } diff --git a/app/Http/Controllers/StatusPageController.php b/app/Http/Controllers/StatusPageController.php index 782d8a08d795..9d29febb8108 100644 --- a/app/Http/Controllers/StatusPageController.php +++ b/app/Http/Controllers/StatusPageController.php @@ -90,11 +90,13 @@ public function showIndex() }); // Add in days that have no incidents - foreach ($incidentDays as $i) { - $date = app(DateFactory::class)->make($startDate)->subDays($i); + if (Config::get('setting.only_disrupted_days') === false) { + foreach ($incidentDays as $i) { + $date = app(DateFactory::class)->make($startDate)->subDays($i); - if (!isset($allIncidents[$date->toDateString()])) { - $allIncidents[$date->toDateString()] = []; + if (!isset($allIncidents[$date->toDateString()])) { + $allIncidents[$date->toDateString()] = []; + } } } diff --git a/config/setting.php b/config/setting.php index c17a6dee8135..e438690a20d7 100644 --- a/config/setting.php +++ b/config/setting.php @@ -88,4 +88,15 @@ */ 'skip_subscriber_verification' => false, + + /* + |-------------------------------------------------------------------------- + | Only disrupted days + |-------------------------------------------------------------------------- + | + | Whether to only show days with incidents, or each day in the timeline. + | + */ + + 'only_disrupted_days' => false, ]; diff --git a/resources/lang/en/forms.php b/resources/lang/en/forms.php index f73059ccce5a..6064a1a8def4 100644 --- a/resources/lang/en/forms.php +++ b/resources/lang/en/forms.php @@ -139,6 +139,7 @@ 'automatic_localization' => 'Automatically localise your status page to your visitor\'s language?', 'enable_external_dependencies' => 'Enable Third Party Dependencies (Google Fonts, Trackers, etc...)', 'show_timezone' => 'Show the timezone the status page is running in.', + 'only_disrupted_days' => 'Only show days containing incidents in the timeline?', ], 'analytics' => [ 'analytics_google' => 'Google Analytics code', diff --git a/resources/views/dashboard/settings/app-setup.blade.php b/resources/views/dashboard/settings/app-setup.blade.php index 4776a70ef370..7ae7f7e08fb5 100644 --- a/resources/views/dashboard/settings/app-setup.blade.php +++ b/resources/views/dashboard/settings/app-setup.blade.php @@ -117,6 +117,17 @@ +
+
+
+ +
+
+