Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
leeovery committed Feb 8, 2020
1 parent db01fc0 commit 7ead7bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions resources/views/app/webhooks/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
<tr>
<td class="text-center">
@if($webhook->isActive())
<i title="Active" class="fas fa-play text-green-500 mr-2"></i>
<i title="Active" class="fas fa-play text-green-500"></i>
@elseif($webhook->isInactive())
<i title="Inactive" class="fas fa-stop text-red-500"></i>
@else
<i title="Inactive" class="fas fa-stop text-red-500 mr-2"></i>
<i title="Draft" class="fas fa-edit text-gray-500 ml-px"></i>
@endif
</td>
<td class="markup-links">
Expand Down Expand Up @@ -73,7 +75,7 @@
>
<x-icon-label icon="fas fa-stop" text="Deactivate"/>
</x-form-button>
@else
@elseif ($webhook->isInactive())
<x-form-button
:action="route('mailcoach-api.webhooks.activate', $webhook)"
method="PUT"
Expand Down
5 changes: 5 additions & 0 deletions src/Models/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public function isInactive()
return $this->status === WebhookStatus::DEACTIVATED;
}

public function isDraft()
{
return $this->status === WebhookStatus::DRAFT;
}

public function activate()
{
$this->status = WebhookStatus::ACTIVATED;
Expand Down

0 comments on commit 7ead7bb

Please sign in to comment.