Merge pull request #2136 from CachetHQ/only-disrupted-days

Option to only show disrupted days. Closes #2088
This commit is contained in:
James Brooks
2016-10-04 20:52:25 +01:00
committed by GitHub
5 changed files with 30 additions and 4 deletions
+1
View File
@@ -78,5 +78,6 @@ class AppComposer
$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'));
}
}
@@ -90,11 +90,13 @@ class StatusPageController extends AbstractApiController
});
// 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()] = [];
}
}
}