Skip to content

Commit 25954a9

Browse files
committed
fix: update view template for push events
1 parent 62b7eff commit 25954a9

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

lang/en/events/github/push.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
return [
44
'default' => [
5-
'title' => '👷⚙️ <b>:count</b> new :noun to 🦑<b>:user:<code>:branch</code></b>',
5+
'title' => '👷⚙️ <b>:count</b> new :noun to 🦊<b>:repo:<code>:branch</code></b>',
66
'commit' => '[:commit] :commit_message - by <i>:commit_by</i>',
7-
'pushed' => '👤 Pushed by : <b>:name</b>',
7+
'pusher' => '👤 Pushed by : <b>:name</b>',
88
],
99
];

lang/en/events/gitlab/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>:repo:<code>:branch</code></b>',
6+
'commit' => '[:commit] :commit_message - by <i>:commit_by</i>',
7+
'pusher' => '👤 Pushed by : <b>:name</b>',
8+
],
9+
];

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{!! __('tg-notifier::events/github/push.default.title', [
1414
'count' => $count,
1515
'noun' => $noun,
16-
'user' => $payload->repository->full_name,
16+
'repo' => $payload->repository->full_name,
1717
'branch' => $branch,
1818
]
1919
) !!}
@@ -30,4 +30,4 @@
3030
) !!}
3131
@endforeach
3232

33-
{!! __('tg-notifier::events/github/push.default.pushed', ['name' => $payload->pusher->name]) !!}
33+
{!! __('tg-notifier::events/github/push.default.pusher', ['name' => $payload->pusher->name]) !!}

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,26 @@
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->project->path_with_namespace}:<code>{$branch}</code></b>\n\n";
13+
{!! __('tg-notifier::events/gitlab/push.default.title', [
14+
'count' => $count,
15+
'noun' => $noun,
16+
'repo' => $payload->project->path_with_namespace,
17+
'branch' => $branch,
18+
]
19+
) !!}
1320

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

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

0 commit comments

Comments
 (0)