初始化
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('title', '文章管理')
|
||||
@section('page-title', '文章管理')
|
||||
@section('actions')
|
||||
<a href="{{ route('admin.articles.create') }}" class="btn btn-primary btn-sm"><x-icon name="plus" :size="16"/> 新建文章</a>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<table class="data-table">
|
||||
<thead><tr><th>标题</th><th>分类</th><th>状态</th><th>发布时间</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
@forelse ($articles as $a)
|
||||
<tr>
|
||||
<td>{{ $a->title }}</td>
|
||||
<td>{{ $a->category?->name ?: '-' }}</td>
|
||||
<td>
|
||||
@if ($a->status === 'approved') 已发布
|
||||
@elseif ($a->status === 'pending') <span class="text-warning">待审</span>
|
||||
@elseif ($a->status === 'rejected') <span class="text-danger">已驳回</span>
|
||||
@else 草稿
|
||||
@endif
|
||||
</td>
|
||||
<td class="muted">{{ $a->published_at?->format('Y-m-d') ?: '-' }}</td>
|
||||
<td class="row-actions">
|
||||
<a href="{{ route('admin.articles.edit', $a) }}" class="btn btn-sm"><x-icon name="edit" :size="16"/></a>
|
||||
<form method="POST" action="{{ route('admin.articles.destroy', $a) }}" onsubmit="return confirm('确认删除该文章?')">
|
||||
@csrf @method('DELETE')
|
||||
<button class="btn btn-sm btn-danger"><x-icon name="trash" :size="16"/></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="5" class="muted">暂无文章。</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $articles->links('pagination::bootstrap-5') }}
|
||||
@endsection
|
||||
Reference in New Issue
Block a user