统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -10,82 +10,94 @@
|
||||
@section('title', '求婚记录')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h2 class="text-xl font-bold text-gray-800">💌 求婚记录</h2>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="text-sm text-indigo-600 hover:underline">← 返回总览</a>
|
||||
</div>
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">💌 求婚记录</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">统一查看求婚进度,并保留婚姻状态语义色彩。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="{{ $adminListSecondaryButtonClass }}">返回总览</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-xs uppercase text-gray-600">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">ID</th>
|
||||
<th class="px-4 py-3 text-left">发起方</th>
|
||||
<th class="px-4 py-3 text-left">目标</th>
|
||||
<th class="px-4 py-3 text-left">戒指</th>
|
||||
<th class="px-4 py-3 text-center">状态</th>
|
||||
<th class="px-4 py-3 text-left">求婚时间</th>
|
||||
<th class="px-4 py-3 text-left">过期时间</th>
|
||||
<th class="px-4 py-3 text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y">
|
||||
@forelse ($proposals as $p)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 text-gray-400 font-mono text-xs">{{ $p->id }}</td>
|
||||
<td class="px-4 py-3 font-bold">{{ $p->user?->username }}</td>
|
||||
<td class="px-4 py-3 font-bold">{{ $p->partner?->username }}</td>
|
||||
<td class="px-4 py-3">{{ $p->ringItem?->icon }} {{ $p->ringItem?->name ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold
|
||||
{{ match ($p->status) {
|
||||
'pending' => 'bg-amber-100 text-amber-700',
|
||||
'rejected' => 'bg-red-100 text-red-600',
|
||||
'expired' => 'bg-gray-100 text-gray-500',
|
||||
'married' => 'bg-emerald-100 text-emerald-700',
|
||||
'divorced' => 'bg-purple-100 text-purple-700',
|
||||
default => 'bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['pending' => '⏳ 等待中', 'rejected' => '❌ 已拒绝', 'expired' => '⏰ 已过期', 'married' => '✅ 已结婚', 'divorced' => '💔 已离婚'][$p->status] ?? $p->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">{{ $p->proposed_at?->format('Y-m-d H:i') }}</td>
|
||||
<td
|
||||
class="px-4 py-3 text-xs {{ $p->expires_at?->isPast() ? 'text-red-400' : 'text-gray-500' }}">
|
||||
{{ $p->expires_at?->format('Y-m-d H:i') }}
|
||||
@if ($p->status === 'pending' && $p->expires_at?->isPast())
|
||||
<span class="text-red-500">(已超时)</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div>
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">求婚列表</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">列表布局、表头、按钮与分页对齐后台统一风格。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">ID</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">发起方</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">目标</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">戒指</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">求婚时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">过期时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($proposals as $p)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }} {{ $adminListNumericTextClass }}">{{ $p->id }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $p->user?->username }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $p->partner?->username }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">{{ $p->ringItem?->icon }} {{ $p->ringItem?->name ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="{{ $adminListBadgeBaseClass }} {{ match ($p->status) {
|
||||
'pending' => 'border-amber-200 bg-amber-100 text-amber-700',
|
||||
'rejected' => 'border-red-200 bg-red-100 text-red-600',
|
||||
'expired' => 'border-gray-200 bg-gray-100 text-gray-500',
|
||||
'married' => 'border-emerald-200 bg-emerald-100 text-emerald-700',
|
||||
'divorced' => 'border-purple-200 bg-purple-100 text-purple-700',
|
||||
default => 'border-gray-200 bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['pending' => '⏳ 等待中', 'rejected' => '❌ 已拒绝', 'expired' => '⏰ 已过期', 'married' => '✅ 已结婚', 'divorced' => '💔 已离婚'][$p->status] ?? $p->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">{{ $p->proposed_at?->format('Y-m-d H:i') }}</td>
|
||||
<td class="px-4 py-3 text-xs {{ $p->expires_at?->isPast() ? 'text-red-400' : 'text-gray-500' }}">
|
||||
{{ $p->expires_at?->format('Y-m-d H:i') }}
|
||||
@if ($p->status === 'pending' && $p->expires_at?->isPast())
|
||||
<span class="text-red-500">(已超时)</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($p->status === 'pending')
|
||||
<form action="{{ route('admin.marriages.cancel-proposal', $p->id) }}" method="POST"
|
||||
data-admin-confirm="确定取消该求婚吗?">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="text-xs bg-amber-50 text-amber-600 font-bold px-3 py-1.5 rounded hover:bg-amber-600 hover:text-white transition">
|
||||
class="{{ $adminListActionButtonClass }} bg-amber-50 text-amber-600 hover:bg-amber-600 hover:text-white">
|
||||
取消求婚
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<span class="text-gray-300 text-xs">—</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-4 py-12 text-center text-gray-400">暂无求婚记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="{{ $adminListEmptyClass }}">暂无求婚记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($proposals->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $proposals->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($proposals->hasPages())
|
||||
<div class="px-4 py-4 border-t">{{ $proposals->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user