Refactor the Filament admin dashboard by decoupling the recent shipments logic into a dedicated widget and improving the sidebar navigation experience. Additionally, implement several improvements to the WordPress theme for better client-side usability. Laravel/Filament: - Extract `RecentShipmentsWidget` from `DashboardInfoWidget` to improve modularization and dashboard performance. - Update widget sorting and layout to accommodate the new structure. - Inject custom CSS and Alpine.js logic into the admin head to provide sidebar group toggling and a "collapse all" utility. - Improve sidebar group label visibility and hover states. WordPress: - Implement `ifnex_login_url()` to support Polylang-aware, language-specific login pages. - Hide the WordPress admin bar for non-administrator users to provide a cleaner client interface. - Add conditional rendering for the registration link in the login template based on WordPress user registration settings.
59 lines
3.2 KiB
PHP
59 lines
3.2 KiB
PHP
<x-filament-widgets::widget>
|
|
<div class="bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between">
|
|
<div class="flex items-center gap-2">
|
|
<x-heroicon-o-truck class="w-5 h-5 text-amber-500" />
|
|
<h3 class="font-bold text-gray-800 dark:text-white">آخرین سفارشات</h3>
|
|
</div>
|
|
<a href="{{ route('filament.admin.resources.shipments.index') }}"
|
|
class="text-xs text-amber-600 hover:text-amber-700 font-semibold">
|
|
مشاهده همه ←
|
|
</a>
|
|
</div>
|
|
|
|
@if($recentShipments->isEmpty())
|
|
<div class="p-8 text-center text-gray-500 dark:text-gray-400">
|
|
<x-heroicon-o-inbox class="w-12 h-12 mx-auto mb-2 text-gray-300" />
|
|
<p>هنوز سفارشی ثبت نشده است</p>
|
|
</div>
|
|
@else
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-sm">
|
|
<thead class="bg-gray-50 dark:bg-gray-900 text-gray-600 dark:text-gray-400">
|
|
<tr>
|
|
<th class="text-right px-4 py-2 font-medium">AWB</th>
|
|
<th class="text-right px-4 py-2 font-medium">مسیر</th>
|
|
<th class="text-right px-4 py-2 font-medium">وضعیت</th>
|
|
<th class="text-right px-4 py-2 font-medium">تاریخ</th>
|
|
<th class="text-right px-4 py-2 font-medium">مبلغ</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100 dark:divide-gray-700">
|
|
@foreach($recentShipments as $shipment)
|
|
<tr class="hover:bg-gray-50 dark:hover:bg-gray-900/50">
|
|
<td class="px-4 py-3 font-mono text-xs font-semibold text-gray-800 dark:text-white">
|
|
{{ $shipment['awb'] }}
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-700 dark:text-gray-300">
|
|
{{ $shipment['route'] }}
|
|
</td>
|
|
<td class="px-4 py-3">
|
|
<span class="inline-block px-2 py-1 rounded-full text-xs font-semibold {{ $shipment['status_color'] }}">
|
|
{{ $shipment['status_label'] }}
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-3 text-xs text-gray-500 dark:text-gray-400">
|
|
{{ $shipment['date'] }}
|
|
</td>
|
|
<td class="px-4 py-3 text-xs font-semibold text-gray-700 dark:text-gray-300">
|
|
{{ $shipment['amount'] }}
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</x-filament-widgets::widget>
|