Skip to content

Commit

Permalink
update view and lang for issue event
Browse files Browse the repository at this point in the history
  • Loading branch information
pxthinh committed Nov 16, 2023
1 parent a531fd5 commit f092a2d
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 46 deletions.
24 changes: 24 additions & 0 deletions lang/en/events/github/issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,28 @@
'closed' => [
'title' => '🚫 <b>Issue Closed </b> to πŸ¦‘ :issue by :user',
],
'deleted' => [
'title' => 'πŸ—‘ <b>Issue Deleted</b> form πŸ¦‘ :issue by :user',
],
'edited' => [
'title' => '⚠️ <b>Issue has been edited</b> to πŸ¦‘ :issue by :user',
],
'locked' => [
'title' => 'πŸ”’ <b>Issue Locked</b> form πŸ¦‘ :issue by :user',
],
'opened' => [
'title' => '⚠️ <b>New Issue</b> to πŸ¦‘ :issue by :user',
],
'pinned' => [
'title' => 'πŸ“Œ <b>Issue Pinned</b> form πŸ¦‘ :issue by :user',
],
'reopened' => [
'title' => '⚠️ <b>Issue has been reopened</b> ⚠️ to πŸ¦‘ :issue by :user',
],
'unlocked' => [
'title' => 'πŸ” <b>Issue Unlocked</b> form πŸ¦‘ :issue by :user',
],
'unpinned' => [
'title' => 'πŸ”” <b>Issue Unpinned</b> form πŸ¦‘ :issue by :user',
],
];
16 changes: 12 additions & 4 deletions resources/views/events/github/issues/deleted.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "οΈπŸ—‘ <b>Issue Deleted</b> form πŸ¦‘<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a> by <a href=\"{$payload->sender->html_url}\">@{$payload->sender->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.deleted.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

echo $message;
@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event'))

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
30 changes: 18 additions & 12 deletions resources/views/events/github/issues/edited.blade.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "⚠️ <b>Issue has been edited</b> to πŸ¦‘<a href=\"{$payload->issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number}</a> by <a href=\"{$payload->issue->user->html_url}\">@{$payload->issue->user->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.edited.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

if (isset($payload->changes->title)) {
$message .= "πŸ“– <b>Title</b> has been changed\n";
$message .= " πŸ“ <b>From:</b> {$payload->changes->title->from}\n";
$message .= " 🏷 <b>To:</b> {$payload->issue->title}\n";
} elseif (isset($payload->changes->body)) {
$message .= "πŸ“– <b>Body</b> 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))
{!! "πŸ“– <b>Title</b> has been changed\n" !!}
{!! " πŸ“ <b>From:</b> {$payload->changes->title->from}\n" !!}
{!! " 🏷 <b>To:</b> {$payload->issue->title}\n" !!}
@elseif(isset($payload->changes->body))
{!! "πŸ“– <b>Body</b> has been changed\n"!!}
{!! "Please check the issue for more details\n"!!}
@endif
16 changes: 11 additions & 5 deletions resources/views/events/github/issues/locked.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "πŸ”’ <b>Issue Locked</b> form πŸ¦‘<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a> by <a href=\"{$payload->sender->html_url}\">@{$payload->sender->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.locked.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

$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'))
16 changes: 11 additions & 5 deletions resources/views/events/github/issues/opened.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "⚠️ <b>New Issue</b> to πŸ¦‘<a href=\"{$payload->issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number}</a> by <a href=\"{$payload->issue->user->html_url}\">@{$payload->issue->user->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.opened.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

$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'))
16 changes: 11 additions & 5 deletions resources/views/events/github/issues/pinned.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "πŸ“Œ <b>Issue Pinned</b> form πŸ¦‘<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a> by <a href=\"{$payload->sender->html_url}\">@{$payload->sender->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.pinned.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

$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'))
16 changes: 11 additions & 5 deletions resources/views/events/github/issues/reopened.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "⚠️ <b>Issue has been reopened</b> ⚠️ to πŸ¦‘<a href=\"{$payload->issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number}</a> by <a href=\"{$payload->issue->user->html_url}\">@{$payload->issue->user->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.reopened.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

$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'))
16 changes: 11 additions & 5 deletions resources/views/events/github/issues/unlocked.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "πŸ” <b>Issue Unlocked</b> form πŸ¦‘<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a> by <a href=\"{$payload->sender->html_url}\">@{$payload->sender->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.unlocked.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

$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'))
16 changes: 11 additions & 5 deletions resources/views/events/github/issues/unpinned.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/
$message = "πŸ”” <b>Issue Unpinned</b> form πŸ¦‘<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name} </a> by <a href=\"{$payload->sender->html_url}\">@{$payload->sender->login}</a>\n\n";
$issue = $payload->issue;
?>

$message .= "πŸ“’ <b>{$payload->issue->title}</b>\n";
{!! __('tg-notifier::events/github/issues.unpinned.title', [
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
]
) !!}

$message .= require __DIR__ . '/../../shared/partials/github/_assignees.php';
{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>

$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'))

0 comments on commit f092a2d

Please sign in to comment.