|
8 | 8 |
|
9 | 9 | $ref = explode('/', $payload->ref); |
10 | 10 | $branch = implode('/', array_slice($ref, 2)); |
| 11 | +$repo = "🦊<a href='{$payload->project->web_url}'>{$payload->project->path_with_namespace}</a>"; |
11 | 12 | ?> |
12 | | - |
13 | | -👷⚙️ {!! __('tg-notifier::events/gitlab/push.default.title', [ |
| 13 | +@if(empty($payload->commits)) {{-- New branch created --}} |
| 14 | +🎊 {!! __('tg-notifier::events/gitlab/push.new_branch_title', [ |
| 15 | + 'repo' => $repo, |
| 16 | +]) !!} |
| 17 | +@else |
| 18 | +👷⚙️ {!! __('tg-notifier::events/gitlab/push.title', [ |
14 | 19 | 'count' => $count, |
15 | 20 | 'noun' => $noun, |
16 | | - 'repo' => "🦑<a href='{$payload->project->web_url}'>{$payload->project->path_with_namespace}</a>", |
| 21 | + 'repo' => $repo, |
17 | 22 | 'branch' => $branch, |
18 | 23 | ]) !!} |
19 | 24 |
|
20 | 25 | @foreach($payload->commits as $commit) |
21 | 26 | @php |
22 | 27 | $commitId = substr($commit->id, -7); |
| 28 | +
|
| 29 | + $commit->message = $commit->message ?? ''; |
| 30 | + $commit->message = explode("\n", $commit->message)[0]; |
23 | 31 | @endphp |
24 | | -{!! __('tg-notifier::events/gitlab/push.default.commit', [ |
| 32 | +{!! __('tg-notifier::events/gitlab/push.commit', [ |
25 | 33 | 'commit' => "<a href='$commit->url'>$commitId</a>", |
26 | 34 | 'commit_message' => $commit->message, |
27 | 35 | 'commit_by' => $commit->author->name, |
28 | 36 | ]) !!} |
| 37 | + |
29 | 38 | @endforeach |
| 39 | +@endif |
30 | 40 |
|
31 | | -{!! __('tg-notifier::events/gitlab/push.default.pusher', ['name' => $payload->user_name]) !!} |
| 41 | +🌲 {{ __('tg-notifier::app.branch') }}: <code>{{ $branch }}</code> |
| 42 | +👤 {!! __('tg-notifier::events/gitlab/push.pusher', ['name' => $payload->user_name]) !!} |
0 commit comments