Skip to content

Commit

Permalink
Merge pull request #39 from pxthinh/feature/add_view_template
Browse files Browse the repository at this point in the history
feat: add view and lang for branch protection rule and deploy key
  • Loading branch information
tanhongit authored Nov 27, 2023
2 parents cb76aad + 5ef6783 commit 150741e
Show file tree
Hide file tree
Showing 19 changed files with 231 additions and 10 deletions.
22 changes: 22 additions & 0 deletions lang/de/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/de/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 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
'deleted' => [
'title' => '🗑 <b>Deploy Key Deleted</b> 💬 from 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
];
4 changes: 2 additions & 2 deletions lang/de/events/github/pull_request_review.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

return [
'dismissed' => [
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'submitted' => [
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'link' => '🔗 Link: :review',
];
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 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
'deleted' => [
'title' => '🗑 <b>Deploy Key Deleted</b> 💬 from 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
];
4 changes: 2 additions & 2 deletions lang/en/events/github/pull_request_review.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

return [
'dismissed' => [
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'submitted' => [
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'link' => '🔗 Link: :review',
];
22 changes: 22 additions & 0 deletions lang/ja/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/ja/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 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
'deleted' => [
'title' => '🗑 <b>Deploy Key Deleted</b> 💬 from 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
];
4 changes: 2 additions & 2 deletions lang/ja/events/github/pull_request_review.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

return [
'dismissed' => [
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'submitted' => [
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'link' => '🔗 Link: :review',
];
22 changes: 22 additions & 0 deletions lang/vi/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/vi/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 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
'deleted' => [
'title' => '🗑 <b>Deploy Key Deleted</b> 💬 from 🦑 :repo by :user',
'message' => 'Please go to the setting deploy key to manage.',
],
];
4 changes: 2 additions & 2 deletions lang/vi/events/github/pull_request_review.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

return [
'dismissed' => [
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️🛠️ <b>Dismissed Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'submitted' => [
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:issue by :user',
'title' => '👷‍♂️‍🛠️ <b>New Pull Request Review Comment</b> 💬 - 🦑:repo by :user',
],
'link' => '🔗 Link: :review',
];
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>"
]
) !!}
14 changes: 14 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,14 @@
<?php
/**
* @var $payload object
*/
?>

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

📢 <b>{{ $payload->key->title }}</b>
{!! __('tg-notifier::events/github/deploy_key.created.message') !!}
14 changes: 14 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,14 @@
<?php
/**
* @var $payload object
*/
?>

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

📢 <b>{{ $payload->key->title }}</b>
{!! __('tg-notifier::events/github/deploy_key.deleted.message') !!}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
?>

{!! __('tg-notifier::events/github/pull_request_review.dismissed.title', [
'issue' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>",
'repo' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>",
'user' => "<a href='{$pull_request->user->html_url}'>@{$pull_request->user->login}</a>"
]
) !!}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
?>

{!! __('tg-notifier::events/github/pull_request_review.submitted.title', [
'issue' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>",
'repo' => "<a href='$pull_request->html_url'>{$payload->repository->full_name}#$pull_request->number</a>",
'user' => "<a href='{$pull_request->user->html_url}'>@{$pull_request->user->login}</a>"
]
) !!}
Expand Down

0 comments on commit 150741e

Please sign in to comment.