Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to only show disrupted days #2136

Merged
merged 1 commit into from
Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Composers/AppComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}
10 changes: 6 additions & 4 deletions app/Http/Controllers/StatusPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()] = [];
}
}
}

Expand Down
11 changes: 11 additions & 0 deletions config/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
1 change: 1 addition & 0 deletions resources/lang/en/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
11 changes: 11 additions & 0 deletions resources/views/dashboard/settings/app-setup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="checkbox">
<label>
<input type="hidden" value="0" name="only_disrupted_days">
<input type="checkbox" value="1" name="only_disrupted_days" {{ $only_disrupted_days ? 'checked' : null }}>
{{ trans('forms.settings.app-setup.only_disrupted_days') }}
</label>
</div>
</div>
</div>
</fieldset>

<div class="row">
Expand Down