Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tonypartridge authored and pxlrbt committed Jul 1, 2024
1 parent c5332db commit 92999e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions resources/views/pages/list-activities.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@php
/* @var \Spatie\Activitylog\Models\Activity $activityItem */
$changes = $activityItem->getChangesAttribute();
$changesCount = $changes->count();
@endphp

<div @class([
Expand All @@ -29,23 +28,23 @@
</div>
</div>
<div class="flex flex-col text-xs text-gray-500 justify-end">
@if ($this->canRestoreActivity() && $changesCount > 0)
@if ($this->canRestoreActivity() && $changes->isNotEmpty())
<x-filament::button
tag="button"
icon="heroicon-o-arrow-path-rounded-square"
labeled-from="sm"
color="gray"
class="right"
wire:click="restoreActivity({{ Js::from($activityItem->getKey()) }})"
>
q >
@lang('filament-activity-log::activities.table.restore')
</x-filament::button>
@endif
</div>
</div>
</div>

@if($changesCount > 0)
@if ($changes->isNotEmpty())
<x-filament-tables::table class="w-full overflow-hidden text-sm">
<x-slot:header>
<x-filament-tables::header-cell>
Expand All @@ -58,7 +57,7 @@ class="right"
@lang('filament-activity-log::activities.table.new')
</x-filament-tables::header-cell>
</x-slot:header>
@foreach(data_get($changes, 'attributes', []) as $field => $change)
@foreach (data_get($changes, 'attributes', []) as $field => $change)
@php
$oldValue = data_get($changes, "old.{$field}");
$newValue = data_get($changes, "attributes.{$field}");
Expand Down

0 comments on commit 92999e0

Please sign in to comment.