Skip to content

Commit

Permalink
Merge pull request #1 from CachetHQ/2.4
Browse files Browse the repository at this point in the history
Update from upstream repo CachetHQ/Cachet
  • Loading branch information
VeekeeFr committed Sep 9, 2017
2 parents 197493b + 7cfcf5e commit 7d4a324
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/Bus/Commands/User/InviteUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class InviteUserCommand
* @var string[]
*/
public $rules = [
'emails' => 'required|array|email',
'emails.*' => 'required|email',
];

/**
Expand Down
1 change: 1 addition & 0 deletions app/Composers/AppComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public function compose(View $view)
$view->withAutomaticLocalization($this->config->get('setting.automatic_localization'));
$view->withEnableExternalDependencies($this->config->get('setting.enable_external_dependencies'));
$view->withShowTimezone($this->config->get('setting.show_timezone'));
$view->withAppRefreshRate($this->config->get('setting.app_refresh_rate'));
$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'));
Expand Down
3 changes: 3 additions & 0 deletions app/Console/Commands/DemoSeederCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ protected function seedSettings()
], [
'key' => 'app_incident_days',
'value' => '7',
], [
'key' => 'app_refresh_rate',
'value' => '0',
], [
'key' => 'app_analytics',
'value' => 'UA-58442674-3',
Expand Down
7 changes: 7 additions & 0 deletions database/factories/ModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@
];
});

$factory->define(Setting::class, function ($faker) {
return [
'name' => 'app_refresh_rate',
'value' => '0',
];
});

$factory->define(Subscriber::class, function ($faker) {
return [
'email' => $faker->safeEmail,
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en-US/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'time_before_refresh' => 'Status page refresh rate (in seconds).',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'subscribers' => 'Allow people to signup to email notifications?',
Expand Down
17 changes: 9 additions & 8 deletions resources/lang/en/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,15 @@
],
// Subscribers
'subscribers' => [
'subscribers' => 'Subscribers',
'description' => 'Subscribers will receive email updates when incidents are created or components are updated.',
'verified' => 'Verified',
'not_verified' => 'Not verified',
'subscriber' => ':email, subscribed :date',
'no_subscriptions' => 'Subscribed to all updates',
'global' => 'Globally subscribed',
'add' => [
'subscribers' => 'Subscribers',
'description' => 'Subscribers will receive email updates when incidents are created or components are updated.',
'description_disabled' => 'To use this feature, you need allow people to signup for notifications.',
'verified' => 'Verified',
'not_verified' => 'Not verified',
'subscriber' => ':email, subscribed :date',
'no_subscriptions' => 'Subscribed to all updates',
'global' => 'Globally subscribed',
'add' => [
'title' => 'Add a new subscriber',
'success' => 'Subscriber has been added!',
'failure' => 'Something went wrong adding the subscriber, please try again.',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
'display-graphs' => 'Display graphs on status page?',
'about-this-page' => 'About this page',
'days-of-incidents' => 'How many days of incidents to show?',
'time_before_refresh' => 'Status page refresh rate (in seconds).',
'banner' => 'Banner Image',
'banner-help' => "It's recommended that you upload files no bigger than 930px wide .",
'subscribers' => 'Allow people to signup to email notifications?',
Expand Down
8 changes: 8 additions & 0 deletions resources/views/dashboard/settings/app-setup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<label>{{ trans('forms.settings.app-setup.time_before_refresh') }}</label>
<input type="number" name="app_refresh_rate" class="form-control" value="{{ Config::get('setting.app_refresh_rate', 0) }}" placeholder="{{ trans('forms.settings.app-setup.time_before_refresh') }}">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="checkbox">
Expand Down
8 changes: 7 additions & 1 deletion resources/views/dashboard/subscribers/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
<div class="content-wrapper header-fixed">
<div class="row">
<div class="col-sm-12">
<p class="lead">{{ trans('dashboard.subscribers.description') }}</p>
<p class="lead">
@if($enable_subscribers)
{{ trans('dashboard.subscribers.description') }}
@else
{{ trans('dashboard.subscribers.description_disabled') }}
@endif
</p>

<div class="striped-list">
@foreach($subscribers as $subscriber)
Expand Down
10 changes: 5 additions & 5 deletions resources/views/dashboard/team/invite.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
<fieldset>
<div class="form-group">
<label>{{ trans('forms.user.team.description') }}</label>
<input type="email" class="form-control" name="emails[]" placeholder="{{ trans('forms.user.team.email', ['id' => 1]) }}" required>
<input type="email" class="form-control" name="emails[]" value="{{ Binput::old('emails')[0] }}" placeholder="{{ trans('forms.user.team.email', ['id' => 1]) }}" required>
</div>
<div class="form-group">
<input type="email" class="form-control" name="emails[]" placeholder="{{ trans('forms.user.team.email', ['id' => 2]) }}">
<input type="email" class="form-control" name="emails[]" value="{{ Binput::old('emails')[1] }}" placeholder="{{ trans('forms.user.team.email', ['id' => 2]) }}">
</div>
<div class="form-group">
<input type="email" class="form-control" name="emails[]" placeholder="{{ trans('forms.user.team.email', ['id' => 3]) }}">
<input type="email" class="form-control" name="emails[]" value="{{ Binput::old('emails')[2] }}" placeholder="{{ trans('forms.user.team.email', ['id' => 3]) }}">
</div>
<div class="form-group">
<input type="email" class="form-control" name="emails[]" placeholder="{{ trans('forms.user.team.email', ['id' => 4]) }}">
<input type="email" class="form-control" name="emails[]" value="{{ Binput::old('emails')[3] }}" placeholder="{{ trans('forms.user.team.email', ['id' => 4]) }}">
</div>
<div class="form-group">
<input type="email" class="form-control" name="emails[]" placeholder="{{ trans('forms.user.team.email', ['id' => 5]) }}">
<input type="email" class="form-control" name="emails[]" value="{{ Binput::old('emails')[4] }}" placeholder="{{ trans('forms.user.team.email', ['id' => 5]) }}">
</div>
</fieldset>

Expand Down
11 changes: 11 additions & 0 deletions resources/views/layout/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@

<script type="text/javascript">
var Global = {};
var refreshRate = parseInt("{{ $app_refresh_rate }}");
function refresh() {
window.location.reload(true);
}
if(refreshRate > 0) {
setTimeout(refresh, refreshRate * 1000);
}
Global.locale = '{{ $app_locale }}';
</script>
<script src="{{ mix('dist/js/all.js') }}"></script>
Expand Down
1 change: 1 addition & 0 deletions resources/views/setup/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@
<hr >
<div class="form-group text-center">
<input type="hidden" name="settings[app_incident_days]" value="7" >
<input type="hidden" name="settings[app_refresh_rate]" value="0" >
<span class="wizard-next btn btn-info" data-current-block="3" data-next-block="2">
{{ trans('pagination.previous') }}
</span>
Expand Down

0 comments on commit 7d4a324

Please sign in to comment.