summaryrefslogtreecommitdiff
path: root/resources/views
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-04-02 00:04:42 +0100
committerSam Light <samlight1994@gmail.com>2025-04-02 00:04:42 +0100
commit233f0a22aff8cbf5aa11d9fc7926814a484ef8e9 (patch)
treed5bb2f5d2f8aab50ccf1bf1adff5f093df939f9c /resources/views
parent719b4a30f9533c9683ec2da61338ec4a9a2d177c (diff)
Created icons for sorting
Diffstat (limited to 'resources/views')
-rw-r--r--resources/views/table.blade.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/resources/views/table.blade.php b/resources/views/table.blade.php
index 448a290..ec2cd25 100644
--- a/resources/views/table.blade.php
+++ b/resources/views/table.blade.php
@@ -11,12 +11,19 @@
@foreach($columns as $column)
<th
scope="col"
- @class(['sortable' => $column->isSortable()])
- @if($column->isSortable())
- wire:click="orderBy('{{ $column->name }}')"
- @endif
>
- {{ $column->getTitle() }}
+ <div
+ @class([
+ 'ordered' => $column->isSortable(),
+ 'ordered-asc' => $column->name === $order && $orderDirection === 'asc',
+ 'ordered-desc' => $column->name === $order && $orderDirection === 'desc',
+ ])
+ @if($column->isSortable())
+ wire:click="orderBy('{{ $column->name }}')"
+ @endif
+ >
+ {{ $column->getTitle() }}
+ </div>
</th>
@endforeach
</tr>