Allow setting of 0 incident days. Closes #920

This commit is contained in:
James Brooks
2015-08-18 21:27:09 +01:00
parent d47121b93d
commit 885c17054f
3 changed files with 11 additions and 3 deletions

View File

@@ -48,8 +48,13 @@ class StatusPageController extends Controller
}
}
$daysToShow = Setting::get('app_incident_days') ?: 7;
$incidentDays = range(0, $daysToShow - 1);
$daysToShow = Setting::get('app_incident_days', 0) - 1;
if ($daysToShow < 0) {
$daysToShow = 0;
$incidentDays = [];
} else {
$incidentDays = range(0, $daysToShow);
}
$dateTimeZone = Setting::get('app_timezone');
$incidentVisiblity = Auth::check() ? 0 : 1;
@@ -77,6 +82,7 @@ class StatusPageController extends Controller
}, SORT_REGULAR, true)->all();
return View::make('index')
->withDaysToShow($daysToShow)
->withAllIncidents($allIncidents)
->withAboutApp(Markdown::convertToHtml(Setting::get('app_about')))
->withCanPageForward((bool) $today->gt($startDate))