统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -9,94 +9,104 @@
|
||||
@section('title', '开发日志管理')
|
||||
|
||||
@section('content')
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h2 class="text-xl font-bold text-gray-800">📋 开发日志管理</h2>
|
||||
<p class="text-sm text-gray-500 mt-1">管理版本更新记录,发布后可在大厅消息区通知用户</p>
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">📋 开发日志管理</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">管理版本更新记录,发布后可在大厅消息区通知用户</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.changelogs.create') }}"
|
||||
class="{{ $adminListPrimaryButtonClass }} inline-flex items-center justify-center">
|
||||
+ 新增日志
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ route('admin.changelogs.create') }}"
|
||||
class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg font-bold text-sm shadow transition">
|
||||
+ 新增日志
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- 日志列表 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr class="text-left text-gray-500 text-xs font-bold uppercase tracking-wider">
|
||||
<th class="px-5 py-3">版本号</th>
|
||||
<th class="px-5 py-3">标题</th>
|
||||
<th class="px-5 py-3">类型</th>
|
||||
<th class="px-5 py-3">状态</th>
|
||||
<th class="px-5 py-3">发布时间</th>
|
||||
<th class="px-5 py-3 text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
@forelse($logs as $log)
|
||||
<tr class="hover:bg-gray-50 transition-colors">
|
||||
<td class="px-5 py-3 font-mono text-indigo-700 font-bold">v{{ $log->version }}</td>
|
||||
<td class="px-5 py-3 text-gray-800 font-medium">{{ $log->title }}</td>
|
||||
<td class="px-5 py-3">
|
||||
@php
|
||||
$typeConfig = \App\Models\DevChangelog::TYPE_CONFIG[$log->type] ?? null;
|
||||
$colorMap = [
|
||||
'emerald' => 'bg-emerald-100 text-emerald-700',
|
||||
'rose' => 'bg-rose-100 text-rose-700',
|
||||
'blue' => 'bg-blue-100 text-blue-700',
|
||||
'slate' => 'bg-slate-100 text-slate-700',
|
||||
];
|
||||
@endphp
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold {{ $colorMap[$typeConfig['color'] ?? 'slate'] ?? 'bg-slate-100 text-slate-700' }}">
|
||||
{{ $typeConfig['label'] ?? '其他' }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-5 py-3">
|
||||
@if ($log->is_published)
|
||||
<span class="px-2 py-0.5 bg-green-100 text-green-700 rounded-full text-xs font-bold">✅
|
||||
已发布</span>
|
||||
@else
|
||||
<span class="px-2 py-0.5 bg-gray-100 text-gray-500 rounded-full text-xs font-bold">🔒
|
||||
草稿</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-5 py-3 text-gray-400 text-xs">
|
||||
{{ $log->published_at?->format('Y-m-d H:i') ?? '—' }}
|
||||
</td>
|
||||
<td class="px-5 py-3 text-right">
|
||||
<div class="flex items-center justify-end gap-2">
|
||||
<a href="{{ route('admin.changelogs.edit', $log->id) }}"
|
||||
class="text-blue-600 hover:text-blue-800 font-semibold text-xs px-2 py-1 rounded hover:bg-blue-50 transition">
|
||||
编辑
|
||||
</a>
|
||||
<form action="{{ route('admin.changelogs.destroy', $log->id) }}" method="POST"
|
||||
data-admin-confirm="确定要删除这条日志吗?">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit"
|
||||
class="text-red-600 hover:text-red-800 font-semibold text-xs px-2 py-1 rounded hover:bg-red-50 transition">
|
||||
删除
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="px-5 py-12 text-center text-gray-400">
|
||||
<p class="text-3xl mb-2">📭</p>
|
||||
<p>还没有任何日志,点击右上角「新增日志」开始吧</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@if ($logs->hasPages())
|
||||
<div class="px-5 py-4 border-t border-gray-100">
|
||||
{{ $logs->links() }}
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">开发日志列表</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">统一查看版本、类型、发布状态与管理操作。</p>
|
||||
</div>
|
||||
@endif
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }} whitespace-nowrap">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">版本号</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">标题</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">类型</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">发布时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse($logs as $log)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-5 py-3 font-mono text-sm font-semibold text-indigo-700">v{{ $log->version }}</td>
|
||||
<td class="px-5 py-3 {{ $adminListPrimaryTextClass }}">{{ $log->title }}</td>
|
||||
<td class="px-5 py-3">
|
||||
@php
|
||||
$typeConfig = \App\Models\DevChangelog::TYPE_CONFIG[$log->type] ?? null;
|
||||
$colorMap = [
|
||||
'emerald' => 'bg-emerald-100 text-emerald-700',
|
||||
'rose' => 'bg-rose-100 text-rose-700',
|
||||
'blue' => 'bg-blue-100 text-blue-700',
|
||||
'slate' => 'bg-slate-100 text-slate-700',
|
||||
];
|
||||
@endphp
|
||||
<span
|
||||
class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-semibold {{ $colorMap[$typeConfig['color'] ?? 'slate'] ?? 'bg-slate-100 text-slate-700' }}">
|
||||
{{ $typeConfig['label'] ?? '其他' }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-5 py-3">
|
||||
@if ($log->is_published)
|
||||
<span class="inline-flex items-center rounded-full bg-green-100 px-2 py-0.5 text-xs font-semibold text-green-700">✅ 已发布</span>
|
||||
@else
|
||||
<span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-xs font-semibold text-gray-500">🔒 草稿</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-5 py-3 {{ $adminListSecondaryTextClass }}">
|
||||
{{ $log->published_at?->format('Y-m-d H:i') ?? '—' }}
|
||||
</td>
|
||||
<td class="px-5 py-3 text-right">
|
||||
<div class="flex items-center justify-end gap-2">
|
||||
<a href="{{ route('admin.changelogs.edit', $log->id) }}"
|
||||
class="{{ $adminListActionButtonClass }} bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white">
|
||||
编辑
|
||||
</a>
|
||||
<form action="{{ route('admin.changelogs.destroy', $log->id) }}" method="POST"
|
||||
data-admin-confirm="确定要删除这条日志吗?">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit"
|
||||
class="{{ $adminListActionButtonClass }} bg-red-50 text-red-600 hover:bg-red-600 hover:text-white">
|
||||
删除
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="{{ $adminListEmptyClass }}">
|
||||
<p class="mb-2 text-3xl">📭</p>
|
||||
<p>还没有任何日志,点击右上角「新增日志」开始吧</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if ($logs->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">
|
||||
{{ $logs->links() }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user