初始化
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', '我的投稿')
|
||||
|
||||
@section('content')
|
||||
<section class="px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
|
||||
<div class="mx-auto max-w-4xl">
|
||||
<div class="mb-6 flex flex-wrap items-center justify-between gap-3">
|
||||
<h1 class="text-2xl font-bold tracking-tight text-fg sm:text-3xl">我的投稿</h1>
|
||||
<a href="{{ route('articles.submit') }}" class="inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white transition hover:bg-primary-hover">
|
||||
<x-icon name="plus" :size="16" /> 新投稿
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if ($articles->isEmpty())
|
||||
<div class="rounded-lg border border-line bg-surface p-8 text-center shadow-soft">
|
||||
<p class="text-sm text-muted">你还没有投稿。</p>
|
||||
<a href="{{ route('articles.submit') }}" class="mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-primary hover:text-primary-hover">去投稿 →</a>
|
||||
</div>
|
||||
@else
|
||||
<div class="overflow-hidden rounded-lg border border-line bg-surface shadow-soft">
|
||||
<table class="w-full text-left text-sm">
|
||||
<thead class="bg-surface-2 text-xs font-semibold text-muted">
|
||||
<tr>
|
||||
<th class="px-4 py-3">标题</th>
|
||||
<th class="px-4 py-3">状态</th>
|
||||
<th class="px-4 py-3">提交时间</th>
|
||||
<th class="px-4 py-3 text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-line">
|
||||
@foreach ($articles as $a)
|
||||
<tr class="transition hover:bg-surface">
|
||||
<td class="px-4 py-3 font-medium text-fg">{{ $a->title }}</td>
|
||||
<td class="px-4 py-3">
|
||||
@if ($a->status === 'approved')
|
||||
<span class="inline-flex items-center rounded-full bg-success-soft px-2.5 py-0.5 text-xs font-medium text-success">已发布</span>
|
||||
@elseif ($a->status === 'pending')
|
||||
<span class="inline-flex items-center rounded-full bg-warning-soft px-2.5 py-0.5 text-xs font-medium text-warning">待审</span>
|
||||
@elseif ($a->status === 'rejected')
|
||||
<span class="inline-flex items-center rounded-full bg-danger-soft px-2.5 py-0.5 text-xs font-medium text-danger">已驳回</span>
|
||||
@else
|
||||
<span class="inline-flex items-center rounded-full bg-surface-2 px-2.5 py-0.5 text-xs font-medium text-muted">草稿</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-muted">{{ $a->created_at?->format('Y-m-d H:i') }}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<a href="{{ route('articles.show', $a->slug) }}" class="inline-flex items-center gap-1 rounded-lg border border-line px-3 py-1.5 text-xs font-medium text-fg transition hover:bg-surface-2 hover:text-primary">查看</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
{{ $articles->links('pagination::bootstrap-5') }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user