[REFACTOR] 簡化權限管理介面,整合權限設定至角色管理,並完成多語系支援
This commit is contained in:
@@ -1,8 +1,29 @@
|
||||
@if ($paginator->hasPages())
|
||||
<div class="flex flex-col sm:flex-row items-center justify-between w-full gap-4">
|
||||
{{-- Total Items Info --}}
|
||||
<div class="order-2 sm:order-1">
|
||||
<p class="text-[10px] sm:text-[11px] font-black text-slate-400 dark:text-slate-500 uppercase tracking-widest text-center sm:text-left">
|
||||
@if ($paginator->total() > 0)
|
||||
<div class="flex flex-col lg:flex-row items-center justify-between w-full gap-6">
|
||||
{{-- Left Side: Limit Selector & Info --}}
|
||||
<div class="order-2 lg:order-1 flex flex-col sm:flex-row items-center gap-4 sm:gap-6">
|
||||
{{-- Limit Selector --}}
|
||||
<div class="flex items-center gap-3 bg-slate-50/50 dark:bg-slate-900/50 px-3 py-1.5 rounded-2xl border border-slate-100 dark:border-slate-800 shadow-sm leading-none">
|
||||
<span class="text-[10px] font-black text-slate-400 dark:text-slate-500 uppercase tracking-widest pl-1 leading-none">{{ __('Show') }}</span>
|
||||
<div class="relative group flex items-center">
|
||||
@php
|
||||
$currentLimit = request('per_page', 10);
|
||||
$limits = [10, 25, 50, 100];
|
||||
@endphp
|
||||
<select onchange="const params = new URLSearchParams(window.location.search); params.set('per_page', this.value); params.delete('page'); window.location.href = window.location.pathname + '?' + params.toString();"
|
||||
class="h-7 pl-2 pr-8 rounded-lg bg-white dark:bg-slate-800 border-none text-[11px] font-black text-slate-600 dark:text-slate-300 appearance-none focus:ring-4 focus:ring-cyan-500/10 outline-none transition-all cursor-pointer shadow-sm leading-none py-0">
|
||||
@foreach($limits as $l)
|
||||
<option value="{{ $l }}" {{ $currentLimit == $l ? 'selected' : '' }}>{{ $l }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none opacity-40 group-hover:opacity-100 transition-opacity">
|
||||
<svg class="size-3 text-cyan-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M19 9l-7 7-7-7"/></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Total Items Info --}}
|
||||
<p class="text-[10px] sm:text-[11px] font-black text-slate-400 dark:text-slate-500 uppercase tracking-widest text-center sm:text-left whitespace-nowrap">
|
||||
<span class="hidden xs:inline">{{ __('Showing') }}</span>
|
||||
<span class="text-slate-600 dark:text-slate-300">{{ $paginator->firstItem() }}</span>
|
||||
{{ __('to') }}
|
||||
@@ -14,7 +35,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="order-1 sm:order-2 flex items-center gap-x-1.5 sm:gap-x-2">
|
||||
<div class="order-1 lg:order-2 flex items-center gap-x-1.5 sm:gap-x-2">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<span class="h-9 inline-flex items-center gap-x-1.5 sm:gap-x-2 px-3 sm:px-4 rounded-xl text-[10px] sm:text-xs font-black bg-slate-50 dark:bg-slate-800 text-slate-300 dark:text-slate-600 border border-slate-100 dark:border-slate-800 cursor-not-allowed">
|
||||
@@ -30,7 +51,9 @@
|
||||
|
||||
{{-- Unified Quick Jump Selection (Desktop & Mobile) --}}
|
||||
<div class="relative group">
|
||||
<select onchange="window.location.href = this.value" class="h-9 pl-4 pr-10 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-700 text-[11px] sm:text-xs font-black text-slate-600 dark:text-slate-300 appearance-none focus:ring-4 focus:ring-cyan-500/10 focus:border-cyan-500 outline-none transition-all cursor-pointer shadow-sm hover:border-slate-300 dark:hover:border-slate-600">
|
||||
<select onchange="window.location.href = this.value"
|
||||
class="h-9 pl-4 pr-10 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-700 text-[11px] sm:text-xs font-black text-slate-600 dark:text-slate-300 appearance-none focus:ring-4 focus:ring-cyan-500/10 focus:border-cyan-500 outline-none transition-all cursor-pointer shadow-sm hover:border-slate-300 dark:hover:border-slate-600 {{ $paginator->lastPage() <= 1 ? 'opacity-50 cursor-not-allowed pointer-events-none' : '' }}"
|
||||
{{ $paginator->lastPage() <= 1 ? 'disabled' : '' }}>
|
||||
@for ($i = 1; $i <= $paginator->lastPage(); $i++)
|
||||
<option value="{{ $paginator->url($i) }}" {{ $i == $paginator->currentPage() ? 'selected' : '' }}>
|
||||
{{ $i }} / {{ $paginator->lastPage() }}
|
||||
|
||||
Reference in New Issue
Block a user