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

Patching manage subscription #3423

Merged
merged 11 commits into from
Jul 11, 2019
4 changes: 0 additions & 4 deletions app/Http/Middleware/SubscribersConfigured.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ public function __construct(Repository $config)
*/
public function handle(Request $request, Closure $next)
{
if (!$this->config->get('setting.enable_subscribers')) {
return cachet_redirect('status-page');
}

return $next($request);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function toSlack($notifiable)

return (new SlackMessage())
->$status()
->content(trans('notifications.component.status_update.slack.subject'))
->content(trans('notifications.component.status_update.slack.title'))
->attachment(function ($attachment) use ($content, $notifiable) {
$attachment->title($content, cachet_route('status-page'))
->fields(array_filter([
Expand Down
5 changes: 2 additions & 3 deletions app/Notifications/Incident/NewIncidentNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,12 @@ public function toSlack($notifiable)
->$status()
->content($content)
->attachment(function ($attachment) use ($notifiable) {
$attachment->title(trans('notifications.incident.new.slack.title', [$this->incident->name]))
$attachment->title(trans('notifications.incident.new.slack.title', ['name' => $this->incident->name]))
->timestamp($this->incident->getWrappedObject()->occurred_at)
->fields(array_filter([
'ID' => "#{$this->incident->id}",
'Link' => $this->incident->permalink,
]))
->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)]));
]));
});
}
}
3 changes: 1 addition & 2 deletions app/Notifications/Schedule/NewScheduleNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public function toSlack($notifiable)
->fields(array_filter([
'ID' => "#{$this->schedule->id}",
'Status' => $this->schedule->human_status,
]))
->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)]));
]));
});
}
}
7 changes: 2 additions & 5 deletions resources/views/dashboard/subscribers/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<span class="uppercase">
<i class="ion ion-ios-email-outline"></i> {{ trans('dashboard.subscribers.subscribers') }}
</span>
@if($currentUser->isAdmin && $enableSubscribers)
@if($currentUser->isAdmin)
<a class="btn btn-md btn-success pull-right" href="{{ cachet_route('dashboard.subscribers.create') }}">
{{ trans('dashboard.subscribers.add.title') }}
</a>
Expand All @@ -19,11 +19,7 @@
<div class="row">
<div class="col-sm-12">
<p class="lead">
@if($enableSubscribers)
{{ trans('dashboard.subscribers.description') }}
@else
{{ trans('dashboard.subscribers.description_disabled') }}
@endif
</p>

<div class="striped-list">
Expand Down Expand Up @@ -51,6 +47,7 @@
@endif
</div>
<div class="col-xs-3 text-right">
<a href="{{ cachet_route('subscribe.manage', $subscriber->verify_code) }}" target="_blank" class="btn btn-success">{{ trans('forms.edit') }}</a>
<a href="{{ cachet_route('dashboard.subscribers.delete', [$subscriber->id], 'delete') }}" class="btn btn-danger confirm-action" data-method='DELETE'>{{ trans('forms.delete') }}</a>
</div>
</div>
Expand Down