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

Feature/view template #27

Merged
merged 12 commits into from
Nov 19, 2023
14 changes: 14 additions & 0 deletions lang/en/events/github/issue_comment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

return [
'issue_comment_title' => '📢',
'created' => [
'title' => '💬 <b>New Issue Comment</b> ⚠️ to 🦑 :issue by :user',
],
'deleted' => [
'title' => '🗑 <b>Issue Comment Deleted</b> 💬 from 🦑 :issue by :user',
],
'edited' => [
'title' => '📝 <b>Issue Comment Edited</b> 💬 in 🦑 :issue by :user',
],
];
35 changes: 35 additions & 0 deletions lang/en/events/github/issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,39 @@
'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',
'changes' => [
'title' => [
'name' => '📖 <b>Title</b> has been changed',
'from' => '📝 <b>From:</b> :title_from',
'to' => '🏷 <b>To:</b> :title_to',
],
'body' => [
'title' => '📖 <b>Body</b> has been changed',
'message' => 'Please check the issue for more details',
],
],
],
'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',
],
];
10 changes: 10 additions & 0 deletions lang/en/events/github/ping.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
'default' => [
'title' => '♻️ <b>Connection Successful</b>',
'organization' => '🏢 Organization: <b>:organization</b>',
'full_name' => '📦 Repository: 🦑<b>:full_name</b>',
'sender' => '👤 Sender (triggered the event): <b>:sender</b>',
],
];
16 changes: 16 additions & 0 deletions lang/en/events/github/pull_request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

return [
'review' => '👥 Reviewers: ',
'closed' => [
'title' => ':title - 🦑:issue by :user',
'title_merged' => '✅ <b>Pull Request Merged</b>',
'title_closed' => '❌ <b>Pull Request Closed</b>',
],
'opened' => [
'title' => '👷‍♂️🛠️ <b>New Pull Request</b> - 🦑:issue by :user',
],
'reopened' => [
'title' => '👷‍♂️🛠️ <b>Reopened Pull Request</b> - 🦑:issue by :user',
],
];
3 changes: 3 additions & 0 deletions lang/en/events/shared/github.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
'_body' => [
'title' => '📖 <b>Content:</b>',
],
'_assignee' => [
'title' => '🙋 Assignee: ',
],
];
20 changes: 20 additions & 0 deletions resources/views/events/github/issue_comment/created.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('tg-notifier::events/github/issue_comment.created.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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issue_comment/deleted.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('tg-notifier::events/github/issue_comment.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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issue_comment/edited.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('tg-notifier::events/github/issue_comment.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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
2 changes: 1 addition & 1 deletion resources/views/events/github/issues/closed.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
]
) !!}

{!! __('tg-notifier::events/github/issues.issue_title') !!} <b><?= $issue->title; ?></b>
📢 <b>{{ $issue->title }}</b>

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

Expand Down
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/deleted.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
26 changes: 26 additions & 0 deletions resources/views/events/github/issues/edited.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event'))
@if(isset($payload->changes->title))
{!! __('tg-notifier::events/github/issues.edited.changes.title.name') !!}
{!! __('tg-notifier::events/github/issues.edited.changes.title.from', ['title_from' => $payload->changes->title->from]) !!}
{!! __('tg-notifier::events/github/issues.edited.changes.title.to', ['title_to' => $payload->issue->title]) !!}
@elseif(isset($payload->changes->body))
{!! __('tg-notifier::events/github/issues.edited.changes.body.title') !!}
{!! __('tg-notifier::events/github/issues.edited.changes.body.message') !!}
@endif
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/locked.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/opened.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/pinned.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/reopened.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/unlocked.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
20 changes: 20 additions & 0 deletions resources/views/events/github/issues/unpinned.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$issue = $payload->issue;
?>

{!! __('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>"
]
) !!}

📢 <b>{{ $issue->title }}</b>

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

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
17 changes: 17 additions & 0 deletions resources/views/events/github/ping/default.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* @var $payload mixed
*/
?>

{!! __('tg-notifier::events/github/ping.default.title') !!}

@if(isset($payload->organization))
{!! __('tg-notifier::events/github/ping.default.organization', ['organization' => $payload->organization->login]) !!}
@endif
@if(isset($payload->repository))
{!! __('tg-notifier::events/github/ping.default.full_name', ['full_name' => $payload->repository->full_name]) !!}
@endif
@if(isset($payload->sender))
{!! __('tg-notifier::events/github/ping.default.sender', ['sender' => $payload->sender->login]) !!}
@endif
29 changes: 29 additions & 0 deletions resources/views/events/github/pull_request/closed.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* @var $payload mixed
* @var $event string
*/

$pull_request = $payload->pull_request;

$message = __('tg-notifier::events/github/pull_request.closed.title_merged');
if (!isset($payload->pull_request->merged) || $payload->pull_request->merged !== true) {
$message = __('tg-notifier::events/github/pull_request.closed.title_closed');
}
?>

{!! __('tg-notifier::events/github/pull_request.closed.title', [
'title' => $message,
'issue' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>",
'user' => "<a href='{$pull_request->user->html_url}'>@{$pull_request->user->login}</a>"
]
) !!}

📢 <b>{{ $pull_request->title }}</b>

🌳 {{ $pull_request->head->ref }} -> {{ $pull_request->base->ref }} 🎯
@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event'))

@include('tg-notifier::events.github.pull_request.partials._reviewers', compact('payload'))

@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
Loading