Skip to content

Commit 1abbdbd

Browse files
committed
fix: update some events for gitlab
1 parent b971be0 commit 1abbdbd

File tree

6 files changed

+55
-20
lines changed

6 files changed

+55
-20
lines changed

lang/en/events/gitlab/tag_push.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
return [
4+
'title' => '⚙️ <b>A new tag has been pushed to the project</b> 🦊:repo',
5+
'tag_name' => '🔖 <b>Tag Name</b>: :tag_name',
6+
'pusher' => '👤 Pushed by: <b>:pusher</b>',
7+
];
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
return [
4+
'title' => [
5+
'create' => '📒 <b>Wiki Page Created</b> - 🦊:repo by :user',
6+
'update' => '📝 <b>Wiki Page Updated</b> - 🦊:repo by :user',
7+
'delete' => '🗑 <b>Wiki Page Deleted</b> - 🦊:repo by :user',
8+
],
9+
'name' => '📝 <b>Wiki Page Name</b>: :name',
10+
];

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
66
$ref = explode('/', $payload->ref);
77
$tag = implode('/', array_slice($ref, 2));
8+
$tagUrl = $payload->project->web_url.'/tags/'.$tag;
9+
?>
810

9-
$tagUrl = $payload->project->web_url . '/tags/' . $tag;
11+
{!! __('tg-notifier::events/gitlab/tag_push.title', [
12+
'repo' => "<a href='{$payload->project->web_url}'>{$payload->project->path_with_namespace}</a>",
13+
]) !!}
1014

11-
$message = "⚙️ <b>A new tag has been pushed to the project</b> 🦊<a href=\"{$payload->project->web_url}\">{$payload->project->path_with_namespace}</a>\n\n";
15+
{!! __('tg-notifier::events/gitlab/tag_push.name', [
16+
'tag_name' => "<a href='{$tagUrl}'>{$tag}</a>",
17+
]) !!}
1218

13-
$message .= "🔖 Tag: <a href=\"{$tagUrl}\">{$tag}</a>\n\n";
14-
15-
$message .= "👤 Pushed by : <b>{$payload->user_name}</b>\n";
16-
17-
echo $message;
19+
{!! __('tg-notifier::events/gitlab/tag_push.pusher', [
20+
'pusher' => "<b>{$payload->user_name}</b>",
21+
]) !!}
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<?php
22
/**
33
* @var $payload object
4+
* @var $event string
45
*/
56
6-
$message = "📒 <b>Wiki Page Created</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a> by <b>{$payload->user->name}</b>\n\n";
7+
{!! __('tg-notifier::events/gitlab/wiki_page.title.create', [
8+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a>",
9+
'user' => "<b>{$payload->user->name}</b>"
10+
]) !!}
711
8-
$message .= "🏷 Title: <b>{$payload->object_attributes->title}</b> \n\n";
12+
{!! __('tg-notifier::events/gitlab/wiki_page.name', [
13+
'name' => "<b>{$payload->object_attributes->title}</b>"
14+
]) !!}
915
10-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
11-
12-
echo $message;
16+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
<?php
22
/**
33
* @var $payload object
4+
* @var $event string
45
*/
56
6-
$message = "🗑 <b>Wiki Page Deleted</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a> by <b>{$payload->user->name}</b>\n\n";
7+
{!! __('tg-notifier::events/gitlab/wiki_page.title.delete', [
8+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a>",
9+
'user' => "<b>{$payload->user->name}</b>"
10+
]) !!}
711
8-
$message .= "🏷 Title: <b>{$payload->object_attributes->title}</b> \n\n";
12+
{!! __('tg-notifier::events/gitlab/wiki_page.name', [
13+
'name' => "<b>{$payload->object_attributes->title}</b>"
14+
]) !!}
915
10-
echo $message;
16+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<?php
22
/**
33
* @var $payload object
4+
* @var $event string
45
*/
56
6-
$message = "📝 <b>Wiki Page Updated</b> - 🦊<a href=\"{$payload->object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a> by <b>{$payload->user->name}</b>\n\n";
7+
{!! __('tg-notifier::events/gitlab/wiki_page.title.update', [
8+
'repo' => "<a href='{$payload->object_attributes->url}'>{$payload->project->path_with_namespace}#{$payload->object_attributes->slug}</a>",
9+
'user' => "<b>{$payload->user->name}</b>"
10+
]) !!}
711
8-
$message .= "🏷 Title: <b>{$payload->object_attributes->title}</b> \n\n";
12+
{!! __('tg-notifier::events/gitlab/wiki_page.name', [
13+
'name' => "<b>{$payload->object_attributes->title}</b>"
14+
]) !!}
915
10-
$message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php';
11-
12-
echo $message;
16+
@include('tg-notifier::events.shared.partials.gitlab._body', compact('payload', 'event'))

0 commit comments

Comments
 (0)