diff --git a/lang/en/events/github/issues.php b/lang/en/events/github/issues.php index ac99d7b..649cfda 100644 --- a/lang/en/events/github/issues.php +++ b/lang/en/events/github/issues.php @@ -5,4 +5,28 @@ 'closed' => [ 'title' => '🚫 Issue Closed to 🦑 :issue by :user', ], + 'deleted' => [ + 'title' => '🗑 Issue Deleted form 🦑 :issue by :user', + ], + 'edited' => [ + 'title' => '⚠️ Issue has been edited to 🦑 :issue by :user', + ], + 'locked' => [ + 'title' => '🔒 Issue Locked form 🦑 :issue by :user', + ], + 'opened' => [ + 'title' => '⚠️ New Issue to 🦑 :issue by :user', + ], + 'pinned' => [ + 'title' => '📌 Issue Pinned form 🦑 :issue by :user', + ], + 'reopened' => [ + 'title' => '⚠️ Issue has been reopened ⚠️ to 🦑 :issue by :user', + ], + 'unlocked' => [ + 'title' => '🔐 Issue Unlocked form 🦑 :issue by :user', + ], + 'unpinned' => [ + 'title' => '🔔 Issue Unpinned form 🦑 :issue by :user', + ], ]; diff --git a/resources/views/events/github/issues/deleted.blade.php b/resources/views/events/github/issues/deleted.blade.php index 6243ff6..a04857d 100644 --- a/resources/views/events/github/issues/deleted.blade.php +++ b/resources/views/events/github/issues/deleted.blade.php @@ -1,12 +1,20 @@ Issue Deleted form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.deleted.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -echo $message; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) + +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/edited.blade.php b/resources/views/events/github/issues/edited.blade.php index bfd0259..115c855 100644 --- a/resources/views/events/github/issues/edited.blade.php +++ b/resources/views/events/github/issues/edited.blade.php @@ -1,21 +1,27 @@ Issue has been edited to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.edited.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -if (isset($payload->changes->title)) { - $message .= "📖 Title has been changed\n"; - $message .= " 📝 From: {$payload->changes->title->from}\n"; - $message .= " 🏷 To: {$payload->issue->title}\n"; -} elseif (isset($payload->changes->body)) { - $message .= "📖 Body has been changed\n"; - $message .= "Please check the issue for more details\n"; -} +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@if(isset($payload->changes->title)) + {!! "📖 Title has been changed\n" !!} + {!! " 📝 From: {$payload->changes->title->from}\n" !!} + {!! " 🏷 To: {$payload->issue->title}\n" !!} +@elseif(isset($payload->changes->body)) + {!! "📖 Body has been changed\n"!!} + {!! "Please check the issue for more details\n"!!} +@endif diff --git a/resources/views/events/github/issues/locked.blade.php b/resources/views/events/github/issues/locked.blade.php index b4dd435..7c2e722 100644 --- a/resources/views/events/github/issues/locked.blade.php +++ b/resources/views/events/github/issues/locked.blade.php @@ -1,14 +1,20 @@ Issue Locked form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.locked.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -$message .= require __DIR__ . '/../../shared/partials/github/_body.php'; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/opened.blade.php b/resources/views/events/github/issues/opened.blade.php index 8783af8..41c4b73 100644 --- a/resources/views/events/github/issues/opened.blade.php +++ b/resources/views/events/github/issues/opened.blade.php @@ -1,14 +1,20 @@ New Issue to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.opened.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -$message .= require __DIR__ . '/../../shared/partials/github/_body.php'; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/pinned.blade.php b/resources/views/events/github/issues/pinned.blade.php index a65aa38..5ef633d 100644 --- a/resources/views/events/github/issues/pinned.blade.php +++ b/resources/views/events/github/issues/pinned.blade.php @@ -1,14 +1,20 @@ Issue Pinned form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.pinned.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -$message .= require __DIR__ . '/../../shared/partials/github/_body.php'; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/reopened.blade.php b/resources/views/events/github/issues/reopened.blade.php index 3de4cd4..c8ca1a2 100644 --- a/resources/views/events/github/issues/reopened.blade.php +++ b/resources/views/events/github/issues/reopened.blade.php @@ -1,14 +1,20 @@ Issue has been reopened ⚠️ to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.reopened.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -$message .= require __DIR__ . '/../../shared/partials/github/_body.php'; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/unlocked.blade.php b/resources/views/events/github/issues/unlocked.blade.php index e29739f..7bc8759 100644 --- a/resources/views/events/github/issues/unlocked.blade.php +++ b/resources/views/events/github/issues/unlocked.blade.php @@ -1,14 +1,20 @@ Issue Unlocked form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.unlocked.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -$message .= require __DIR__ . '/../../shared/partials/github/_body.php'; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event')) diff --git a/resources/views/events/github/issues/unpinned.blade.php b/resources/views/events/github/issues/unpinned.blade.php index 33cec4f..0a8e287 100644 --- a/resources/views/events/github/issues/unpinned.blade.php +++ b/resources/views/events/github/issues/unpinned.blade.php @@ -1,14 +1,20 @@ Issue Unpinned form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; +$issue = $payload->issue; +?> -$message .= "📢 {$payload->issue->title}\n"; +{!! __('tg-notifier::events/github/issues.unpinned.title', [ + 'issue' => "{$payload->repository->full_name}#$issue->number", + 'user' => "@{$issue->user->login}" + ] + ) !!} -$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; +{!! __('tg-notifier::events/github/issues.issue_title') !!} title; ?> -$message .= require __DIR__ . '/../../shared/partials/github/_body.php'; +@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event')) -echo $message; +@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))