Skip to content

Commit

Permalink
feat: add view and lang for branch protection rule and deploy key
Browse files Browse the repository at this point in the history
  • Loading branch information
pxthinh committed Nov 26, 2023
1 parent cb76aad commit ef9e74a
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lang/en/events/github/branch_protection_rule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

return [
'created' => [
'title' => '⚠️ <b>New Branch Protection Rules</b> form 🦑:user',
'link' => '🔗 Link: :link',
],
'edited' => [
'title' => '📝 <b>Branch Protection Rules Have Been Edited</b> form 🦑:user',
'changes' => [
'title' => [
'name' => '📖 <b>Title</b> has been changed',
'from' => '📝 <b>From:</b> :title_from',
'to' => '🏷 <b>To:</b> :title_to',
],
],
'link' => '🔗 Link: :link',
],
'deleted' => [
'title' => '🗑 <b>Branch Protection Rules Deleted</b> form 🦑:user',
],
];
12 changes: 12 additions & 0 deletions lang/en/events/github/deploy_key.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

return [
'created' => [
'title' => '💬 <b>Added Deploy Key</b> ⚠️ from 🦑 :issue by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
'deleted' => [
'title' => '🗑 <b>Deploy Key Deleted</b> 💬 from 🦑 :issue by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
* @var $payload object
*/
$repository = $payload->repository;
?>

{!! __('tg-notifier::events/github/branch_protection_rule.deleted.title', [
'user' => "<a href='$repository->html_url'>$repository->full_name</a>"
]
) !!}

📢 <b>{{ $payload->rule->name }}</b>

{!! __('tg-notifier::events/github/branch_protection_rule.created.link', [
'link' => "<a href='$repository->html_url/settings/branch_protection_rules/{$payload->rule->id}'>{$repository->html_url}/settings/branch_protection_rules/{$payload->rule->id}</a>"
]
) !!}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/**
* @var $payload object
*/
$repository = $payload->repository;
?>

{!! __('tg-notifier::events/github/branch_protection_rule.deleted.title', [
'user' => "<a href='$repository->html_url'>$repository->full_name</a>"
]
) !!}

📢 <b>{{ $payload->rule->name }}</b>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* @var $payload object
*/
$repository = $payload->repository;
?>

{!! __('tg-notifier::events/github/branch_protection_rule.edited.title', [
'user' => "<a href='$repository->html_url'>$repository->full_name</a>"
]
) !!}

@if(isset($payload->changes->name->from))
{!! __('tg-notifier::events/github/issues.edited.changes.title.from', ['title_from' => $payload->changes->name->from]) !!}
{!! __('tg-notifier::events/github/issues.edited.changes.title.to', ['title_to' => $payload->rule->name]) !!}
@else
📢 <b>{{ $payload->rule->name }}</b>
@endif

{!! __('tg-notifier::events/github/branch_protection_rule.edited.link', [
'link' => "<a href='$repository->html_url/settings/branch_protection_rules/{$payload->rule->id}'>{$repository->html_url}/settings/branch_protection_rules/{$payload->rule->id}</a>"
]
) !!}
16 changes: 16 additions & 0 deletions resources/views/events/github/deploy_key/created.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @var $payload object
*/
$repository = $payload->repository;
?>

{!! __('tg-notifier::events/github/deploy_key.created.title', [
'issue' => "<a href='$repository->html_url'>$repository->full_name</a>",
'user' => "<b>{$payload->key->added_by}</b>",
]
) !!}

📢 <b>{{ $payload->key->title }}</b>
{!! __('tg-notifier::events/github/deploy_key.created.message') !!}
16 changes: 16 additions & 0 deletions resources/views/events/github/deploy_key/deleted.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @var $payload object
*/
$repository = $payload->repository;
?>

{!! __('tg-notifier::events/github/deploy_key.deleted.title', [
'issue' => "<a href='$repository->html_url'>$repository->full_name</a>",
'user' => "<b>{$payload->key->added_by}</b>",
]
) !!}

📢 <b>{{ $payload->key->title }}</b>
{!! __('tg-notifier::events/github/deploy_key.deleted.message') !!}

0 comments on commit ef9e74a

Please sign in to comment.