Skip to content

Commit f8849bf

Browse files
authored
Merge pull request #41 from pxthinh/feature/add_view_template
update view template for some github events
2 parents 42681e6 + d18bbca commit f8849bf

File tree

23 files changed

+363
-4
lines changed

23 files changed

+363
-4
lines changed

config/telegram-git-notifier.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878

7979
/** Set the path to the view file */
8080
'view' => [
81+
'ignore-message' => env('IGNORE_MESSAGE', 'ignore-message'),
82+
8183
'namespace' => env('TGN_VIEW_NAMESPACE', 'tg-notifier'),
8284

8385
'default' => env(

lang/de/events/github/label.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
return [
4+
'created' => [
5+
'title' => '💬 <b>New Label</b> ⚠️ - 🦑:repo by :user',
6+
],
7+
'deleted' => [
8+
'title' => '🗑 <b>Label Deleted</b> - 🦑:repo by :user',
9+
],
10+
'edited' => [
11+
'title' => '👷‍♂️🛠️ <b>Label has been edited</b> - 🦑:repo by :user',
12+
'changes' => [
13+
'title' => [
14+
'name' => '📖 <b>Title</b> has been changed',
15+
'from' => '📝 <b>From:</b> :title_from',
16+
'to' => '🏷 <b>To:</b> :title_to',
17+
],
18+
'description' => [
19+
'name' => '📖 <b>Description</b> has been changed',
20+
'from' => '📝 <b>From:</b> :description_from',
21+
'to' => '🏷 <b>To:</b> :description_to',
22+
],
23+
],
24+
],
25+
];

lang/de/events/github/pull_request.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,35 @@
22

33
return [
44
'review' => '👥 Reviewers: ',
5+
'assigned' => [
6+
'title' => '‍👷‍♂️🛠️ <b>Assigned Pull Request</b> - 🦑:repo by :user',
7+
'body' => ':name has been assigned in the pull request <b>:pullRequest</b>',
8+
],
59
'closed' => [
610
'title' => ':title - 🦑:repo by :user',
711
'title_merged' => '✅ <b>Pull Request Merged</b>',
812
'title_closed' => '🚫 <b>Pull Request Closed</b>',
913
],
14+
'labeled' => [
15+
'title' => '‍👷‍♂️🛠️ <b>Labeled Pull Request</b> - 🦑:repo by :user',
16+
],
17+
'locked' => [
18+
'title' => '‍👷‍♂️🛠️ <b>Locked Pull Request</b> - 🦑:repo by :user',
19+
],
1020
'opened' => [
1121
'title' => '👷‍♂️🛠️ <b>New Pull Request</b> - 🦑:repo by :user',
1222
],
1323
'reopened' => [
1424
'title' => '👷‍♂️🛠️ <b>Reopened Pull Request</b> - 🦑:repo by :user',
1525
],
26+
'unassigned' => [
27+
'title' => '‍👷‍♂️🛠️ <b>Unassigned Pull Request</b> - 🦑:repo by :user',
28+
'body' => ':name has been unassigned in the pull request <b>:pullRequest</b>',
29+
],
30+
'unlabeled' => [
31+
'title' => '‍👷‍♂️🛠️ <b>Unlabeled Pull Request</b> - 🦑:repo by :user',
32+
],
33+
'unlocked' => [
34+
'title' => '‍👷‍♂️🛠️ <b>Unlocked Pull Request</b> - 🦑:repo by :user',
35+
],
1636
];

lang/en/events/github/label.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
return [
4+
'created' => [
5+
'title' => '💬 <b>New Label</b> ⚠️ - 🦑:repo by :user',
6+
],
7+
'deleted' => [
8+
'title' => '🗑 <b>Label Deleted</b> - 🦑:repo by :user',
9+
],
10+
'edited' => [
11+
'title' => '👷‍♂️🛠️ <b>Label has been edited</b> - 🦑:repo by :user',
12+
'changes' => [
13+
'title' => [
14+
'name' => '📖 <b>Title</b> has been changed',
15+
'from' => '📝 <b>From:</b> :title_from',
16+
'to' => '🏷 <b>To:</b> :title_to',
17+
],
18+
'description' => [
19+
'name' => '📖 <b>Description</b> has been changed',
20+
'from' => '📝 <b>From:</b> :description_from',
21+
'to' => '🏷 <b>To:</b> :description_to',
22+
],
23+
],
24+
],
25+
];

lang/en/events/github/pull_request.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,35 @@
22

33
return [
44
'review' => '👥 Reviewers: ',
5+
'assigned' => [
6+
'title' => '‍👷‍♂️🛠️ <b>Assigned Pull Request</b> - 🦑:repo by :user',
7+
'body' => ':name has been assigned in the pull request <b>:pullRequest</b>',
8+
],
59
'closed' => [
610
'title' => ':title - 🦑:repo by :user',
711
'title_merged' => '✅ <b>Pull Request Merged</b>',
812
'title_closed' => '🚫 <b>Pull Request Closed</b>',
913
],
14+
'labeled' => [
15+
'title' => '‍👷‍♂️🛠️ <b>Labeled Pull Request</b> - 🦑:repo by :user',
16+
],
17+
'locked' => [
18+
'title' => '‍👷‍♂️🛠️ <b>Locked Pull Request</b> - 🦑:repo by :user',
19+
],
1020
'opened' => [
1121
'title' => '👷‍♂️🛠️ <b>New Pull Request</b> - 🦑:repo by :user',
1222
],
1323
'reopened' => [
1424
'title' => '👷‍♂️🛠️ <b>Reopened Pull Request</b> - 🦑:repo by :user',
1525
],
26+
'unassigned' => [
27+
'title' => '‍👷‍♂️🛠️ <b>Unassigned Pull Request</b> - 🦑:repo by :user',
28+
'body' => ':name has been unassigned in the pull request <b>:pullRequest</b>',
29+
],
30+
'unlabeled' => [
31+
'title' => '‍👷‍♂️🛠️ <b>Unlabeled Pull Request</b> - 🦑:repo by :user',
32+
],
33+
'unlocked' => [
34+
'title' => '‍👷‍♂️🛠️ <b>Unlocked Pull Request</b> - 🦑:repo by :user',
35+
],
1636
];

lang/ja/events/github/label.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
return [
4+
'created' => [
5+
'title' => '💬 <b>New Label</b> ⚠️ - 🦑:repo by :user',
6+
],
7+
'deleted' => [
8+
'title' => '🗑 <b>Label Deleted</b> - 🦑:repo by :user',
9+
],
10+
'edited' => [
11+
'title' => '👷‍♂️🛠️ <b>Label has been edited</b> - 🦑:repo by :user',
12+
'changes' => [
13+
'title' => [
14+
'name' => '📖 <b>Title</b> has been changed',
15+
'from' => '📝 <b>From:</b> :title_from',
16+
'to' => '🏷 <b>To:</b> :title_to',
17+
],
18+
'description' => [
19+
'name' => '📖 <b>Description</b> has been changed',
20+
'from' => '📝 <b>From:</b> :description_from',
21+
'to' => '🏷 <b>To:</b> :description_to',
22+
],
23+
],
24+
],
25+
];

lang/ja/events/github/pull_request.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,35 @@
22

33
return [
44
'review' => '👥 Reviewers: ',
5+
'assigned' => [
6+
'title' => '‍👷‍♂️🛠️ <b>Assigned Pull Request</b> - 🦑:repo by :user',
7+
'body' => ':name has been assigned in the pull request <b>:pullRequest</b>',
8+
],
59
'closed' => [
610
'title' => ':title - 🦑:repo by :user',
711
'title_merged' => '✅ <b>Pull Request Merged</b>',
812
'title_closed' => '🚫 <b>Pull Request Closed</b>',
913
],
14+
'labeled' => [
15+
'title' => '‍👷‍♂️🛠️ <b>Labeled Pull Request</b> - 🦑:repo by :user',
16+
],
17+
'locked' => [
18+
'title' => '‍👷‍♂️🛠️ <b>Locked Pull Request</b> - 🦑:repo by :user',
19+
],
1020
'opened' => [
1121
'title' => '👷‍♂️🛠️ <b>New Pull Request</b> - 🦑:repo by :user',
1222
],
1323
'reopened' => [
1424
'title' => '👷‍♂️🛠️ <b>Reopened Pull Request</b> - 🦑:repo by :user',
1525
],
26+
'unassigned' => [
27+
'title' => '‍👷‍♂️🛠️ <b>Unassigned Pull Request</b> - 🦑:repo by :user',
28+
'body' => ':name has been unassigned in the pull request <b>:pullRequest</b>',
29+
],
30+
'unlabeled' => [
31+
'title' => '‍👷‍♂️🛠️ <b>Unlabeled Pull Request</b> - 🦑:repo by :user',
32+
],
33+
'unlocked' => [
34+
'title' => '‍👷‍♂️🛠️ <b>Unlocked Pull Request</b> - 🦑:repo by :user',
35+
],
1636
];

lang/vi/events/github/label.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
return [
4+
'created' => [
5+
'title' => '💬 <b>New Label</b> ⚠️ - 🦑:repo by :user',
6+
],
7+
'deleted' => [
8+
'title' => '🗑 <b>Label Deleted</b> - 🦑:repo by :user',
9+
],
10+
'edited' => [
11+
'title' => '👷‍♂️🛠️ <b>Label has been edited</b> - 🦑:repo by :user',
12+
'changes' => [
13+
'title' => [
14+
'name' => '📖 <b>Title</b> has been changed',
15+
'from' => '📝 <b>From:</b> :title_from',
16+
'to' => '🏷 <b>To:</b> :title_to',
17+
],
18+
'description' => [
19+
'name' => '📖 <b>Description</b> has been changed',
20+
'from' => '📝 <b>From:</b> :description_from',
21+
'to' => '🏷 <b>To:</b> :description_to',
22+
],
23+
],
24+
],
25+
];

lang/vi/events/github/pull_request.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,35 @@
22

33
return [
44
'review' => '👥 Reviewers: ',
5+
'assigned' => [
6+
'title' => '‍👷‍♂️🛠️ <b>Assigned Pull Request</b> - 🦑:repo by :user',
7+
'body' => ':name has been assigned in the pull request <b>:pullRequest</b>',
8+
],
59
'closed' => [
610
'title' => ':title - 🦑:repo by :user',
711
'title_merged' => '✅ <b>Pull Request Merged</b>',
812
'title_closed' => '🚫 <b>Pull Request Closed</b>',
913
],
14+
'labeled' => [
15+
'title' => '‍👷‍♂️🛠️ <b>Labeled Pull Request</b> - 🦑:repo by :user',
16+
],
17+
'locked' => [
18+
'title' => '‍👷‍♂️🛠️ <b>Locked Pull Request</b> - 🦑:repo by :user',
19+
],
1020
'opened' => [
1121
'title' => '👷‍♂️🛠️ <b>New Pull Request</b> - 🦑:repo by :user',
1222
],
1323
'reopened' => [
1424
'title' => '👷‍♂️🛠️ <b>Reopened Pull Request</b> - 🦑:repo by :user',
1525
],
26+
'unassigned' => [
27+
'title' => '‍👷‍♂️🛠️ <b>Unassigned Pull Request</b> - 🦑:repo by :user',
28+
'body' => ':name has been unassigned in the pull request <b>:pullRequest</b>',
29+
],
30+
'unlabeled' => [
31+
'title' => '‍👷‍♂️🛠️ <b>Unlabeled Pull Request</b> - 🦑:repo by :user',
32+
],
33+
'unlocked' => [
34+
'title' => '‍👷‍♂️🛠️ <b>Unlocked Pull Request</b> - 🦑:repo by :user',
35+
],
1636
];

resources/views/events/github/issue_comment/created.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
$issue = $payload->issue;
88
?>
99

10+
@if(empty($issue->pull_request))
1011
{!! __('tg-notifier::events/github/issue_comment.created.title', [
11-
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
12-
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
13-
]
14-
) !!}
12+
'issue' => "<a href='$issue->html_url'>{$payload->repository->full_name}#$issue->number</a>",
13+
'user' => "<a href='{$issue->user->html_url}'>@{$issue->user->login}</a>"
14+
]
15+
) !!}
1516

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

1819
@include('tg-notifier::events.shared.partials.github._assignees', compact('payload', 'event'))
1920
@include('tg-notifier::events.shared.partials.github._body', compact('payload', 'event'))
21+
@else
22+
{{ config('telegram-git-notifier.view.ignore-message') }}
23+
@endif

0 commit comments

Comments
 (0)