初始化
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('title', '审核队列')
|
||||
@section('page-title', '审核队列')
|
||||
|
||||
@section('actions')
|
||||
@if ($canArticles)
|
||||
<a href="{{ route('admin.moderation.index', ['tab' => 'articles']) }}" class="btn btn-sm @if($tab === 'articles') btn-primary @endif">文章投稿</a>
|
||||
@endif
|
||||
@if ($canForum)
|
||||
<a href="{{ route('admin.moderation.index', ['tab' => 'threads']) }}" class="btn btn-sm @if($tab === 'threads') btn-primary @endif">论坛帖子</a>
|
||||
<a href="{{ route('admin.moderation.index', ['tab' => 'replies']) }}" class="btn btn-sm @if($tab === 'replies') btn-primary @endif">回复</a>
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($tab === 'articles' && $articles)
|
||||
@if ($articles->isEmpty())
|
||||
<p class="muted">暂无待审文章。</p>
|
||||
@else
|
||||
<table class="data-table">
|
||||
<thead><tr><th>标题</th><th>投稿人</th><th>分类</th><th>摘要</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
@foreach ($articles as $a)
|
||||
<tr>
|
||||
<td>{{ $a->title }}</td>
|
||||
<td>{{ $a->user?->name ?? '管理员' }}</td>
|
||||
<td>{{ $a->category?->name ?: '-' }}</td>
|
||||
<td class="muted">{{ Str::limit(strip_tags($a->summary ?: $a->body), 40) }}</td>
|
||||
<td class="row-actions">
|
||||
<form method="POST" action="{{ route('admin.moderation.articles.approve', $a) }}" style="display:inline">
|
||||
@csrf<button class="btn btn-sm btn-primary">通过</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ route('admin.moderation.articles.reject', $a) }}" style="display:inline">
|
||||
@csrf<button class="btn btn-sm btn-danger">驳回</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $articles->links('pagination::bootstrap-5') }}
|
||||
@endif
|
||||
|
||||
@elseif ($tab === 'threads' && $threads)
|
||||
@if ($threads->isEmpty())
|
||||
<p class="muted">暂无待审帖子。</p>
|
||||
@else
|
||||
<table class="data-table">
|
||||
<thead><tr><th>标题</th><th>作者</th><th>板块</th><th>内容</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
@foreach ($threads as $t)
|
||||
<tr>
|
||||
<td>{{ $t->title }}</td>
|
||||
<td>{{ $t->user?->name ?? '-' }}</td>
|
||||
<td>{{ $t->board?->name ?: '-' }}</td>
|
||||
<td class="muted">{{ Str::limit(strip_tags($t->body), 40) }}</td>
|
||||
<td class="row-actions">
|
||||
<form method="POST" action="{{ route('admin.moderation.threads.approve', $t) }}" style="display:inline">
|
||||
@csrf<button class="btn btn-sm btn-primary">通过</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ route('admin.moderation.threads.reject', $t) }}" style="display:inline">
|
||||
@csrf<button class="btn btn-sm btn-danger">驳回</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $threads->links('pagination::bootstrap-5') }}
|
||||
@endif
|
||||
|
||||
@elseif ($tab === 'replies' && $replies)
|
||||
@if ($replies->isEmpty())
|
||||
<p class="muted">暂无待审回复。</p>
|
||||
@else
|
||||
<table class="data-table">
|
||||
<thead><tr><th>回复内容</th><th>作者</th><th>所属帖子</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
@foreach ($replies as $r)
|
||||
<tr>
|
||||
<td class="muted">{{ Str::limit(strip_tags($r->body), 60) }}</td>
|
||||
<td>{{ $r->user?->name ?? '-' }}</td>
|
||||
<td>{{ $r->thread?->title ?: '-' }}</td>
|
||||
<td class="row-actions">
|
||||
<form method="POST" action="{{ route('admin.moderation.replies.approve', $r) }}" style="display:inline">
|
||||
@csrf<button class="btn btn-sm btn-primary">通过</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ route('admin.moderation.replies.reject', $r) }}" style="display:inline">
|
||||
@csrf<button class="btn btn-sm btn-danger">驳回</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $replies->links('pagination::bootstrap-5') }}
|
||||
@endif
|
||||
|
||||
@else
|
||||
<p class="muted">暂无待审内容。</p>
|
||||
@endif
|
||||
@endsection
|
||||
Reference in New Issue
Block a user