Skip to content

Commit 0d17a8e

Browse files
committed
feat: update view and lang for push event and watch event
1 parent cbc40b5 commit 0d17a8e

File tree

4 files changed

+41
-12
lines changed

4 files changed

+41
-12
lines changed

lang/en/events/github/push.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
return [
4+
'default' => [
5+
'title' => '👷⚙️ <b>:count</b> new :noun to 🦑<b>:user:<code>:branch</code></b>',
6+
'commit' => ':commit: :commit_message - by <i>:commit_name</i>',
7+
'pushed' => '👤 Pushed by : <b>:name</b>',
8+
],
9+
];

lang/en/events/github/watch.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
return [
4+
'started' => [
5+
'title' => '🎉 <b>Watch Started</b> form 🦑:user',
6+
'watcher' => '👤 Watcher: <b>:sender_login</b> 👀',
7+
],
8+
];

resources/views/events/github/push/default.blade.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,24 @@
88
99
$ref = explode('/', $payload->ref);
1010
$branch = implode('/', array_slice($ref, 2));
11+
?>
1112

12-
$message = "⚙️ <b>{$count}</b> new {$noun} to 🦑<b>{$payload->repository->full_name}:<code>{$branch}</code></b>\n\n";
13+
{!! __('tg-notifier::events/github/push.default.title', [
14+
'count' => $count,
15+
'noun' => $noun,
16+
'user' => $payload->repository->full_name,
17+
'branch' => $branch,
18+
]
19+
) !!}
1320

14-
foreach ($payload->commits as $commit) {
15-
$commitId = substr($commit->id, -7);
16-
$message .= "<a href=\"{$commit->url}\">{$commitId}</a>: {$commit->message} - by <i>{$commit->author->name}</i>\n";
17-
}
21+
@foreach($payload->commits as $commit)
22+
<?= $commitId = substr($commit->id, -7);?>
23+
{!! __('tg-notifier::events/github/push.default.commit', [
24+
'commit' => "<a href='$commit->url'>$commitId</a>",
25+
'commit_message' => $commit->message,
26+
'commit_name' => $commit->author->name,
27+
]
28+
) !!}
29+
@endforeach
1830

19-
$message .= "\n👤 Pushed by : <b>{$payload->pusher->name}</b>\n";
20-
21-
echo $message;
31+
{!! __('tg-notifier::events/github/push.default.pushed', ['name' => $payload->pusher->name]) !!}

resources/views/events/github/watch/started.blade.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
/**
33
* @var $payload mixed
44
*/
5+
?>
56

6-
$message = "🎉 <b>Watch Started</b> form 🦑<a href=\"{$payload->repository->html_url}\">{$payload->repository->full_name}</a>\n\n";
7+
{!! __('tg-notifier::events/github/watch.started.title', [
8+
'user' => "<a href='{$payload->repository->html_url}'>{$payload->repository->full_name}</a>"
9+
]
10+
) !!}
711

8-
$message .= "👤 Watcher: <b>{$payload->sender->login}</b> 👀\n\n";
9-
10-
echo $message;
12+
{!! __('tg-notifier::events/github/watch.started.watched', ['sender_login' => $payload->sender->login]) !!}

0 commit comments

Comments
 (0)