Skip to content

Commit

Permalink
fix: update view edited for label
Browse files Browse the repository at this point in the history
  • Loading branch information
pxthinh committed Dec 2, 2023
1 parent 190024e commit 1db4db5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions resources/views/events/github/label/edited.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
$changes = $payload->changes;
$label = $payload->label;
$description = strlen($label->description) > 50 ? $label->description : substr($label->description, 0, 50).'...';
$description_changes = strlen($changes->name->description) > 50 ? $changes->name->description : substr($changes->name->description, 0, 50).'...';
$description = strlen($label->description) < 50 ? $label->description : substr($label->description, 0, 50).'...';
if (isset($changes->description->from)) {
$description_changes = strlen($changes->description->from) < 50 ? $changes->description->from : substr($changes->description->from, 0, 50).'...';
}
?>

{!! __('tg-notifier::events/github/label.edited.title', [
Expand All @@ -15,17 +17,18 @@
]
) !!}


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

@if(isset($changes->name->description))
{!! __('tg-notifier::events/github/label.edited.changes.description.from', ['description_from' => $description_changes]) !!}
{!! __('tg-notifier::events/github/label.edited.changes.description.to', ['description_to' =>$description]) !!}
@if(isset($changes->description->from))
{!! __('tg-notifier::events/github/label.edited.changes.description.name') !!}
{!! __('tg-notifier::events/github/label.edited.changes.description.from', ['description_from' => $description_changes]) !!}
{!! __('tg-notifier::events/github/label.edited.changes.description.to', ['description_to' => $description]) !!}
@else
{{ $description }}
@endif

0 comments on commit 1db4db5

Please sign in to comment.