Skip to content

Commit

Permalink
Ensure we have fields for rendering restore and table.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonypartridge authored Jul 1, 2024
1 parent af3f158 commit e27a339
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion resources/views/pages/list-activities.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<x-filament-panels::page>
<div class="space-y-6">
@foreach($this->getActivities() as $activityItem)

@php
/* @var \Spatie\Activitylog\Models\Activity $activityItem */
$changes = $activityItem->getChangesAttribute();
$changesCount = $changes->count();
@endphp

<div @class([
'p-2 space-y-2 bg-white rounded-xl shadow',
'dark:border-gray-600 dark:bg-gray-800',
Expand All @@ -22,7 +29,7 @@
</div>
</div>
<div class="flex flex-col text-xs text-gray-500 justify-end">
@if ($this->canRestoreActivity())
@if ($this->canRestoreActivity() && $changesCount > 0)
<x-filament::button
tag="button"
icon="heroicon-o-arrow-path-rounded-square"
Expand All @@ -38,6 +45,8 @@ class="right"
</div>
</div>

@if($changesCount > 0))

<x-filament-tables::table class="w-full overflow-hidden text-sm">
<x-slot:header>
<x-filament-tables::header-cell>
Expand Down Expand Up @@ -80,6 +89,7 @@ class="right"
</x-filament-tables::row>
@endforeach
</x-filament-tables::table>
@endif
</div>
@endforeach

Expand Down

0 comments on commit e27a339

Please sign in to comment.