73 lines
3.4 KiB
PHP
73 lines
3.4 KiB
PHP
@extends('admin::layouts.app')
|
|
|
|
@section('title', 'Posts')
|
|
|
|
@section('content')
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h1 class="text-xl font-semibold text-gray-900">
|
|
Posts — <span class="font-normal text-gray-500">{{ $channel->name }}</span>
|
|
</h1>
|
|
<a href="{{ route('admin.posts.create') }}"
|
|
class="px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-medium rounded">
|
|
New post
|
|
</a>
|
|
</div>
|
|
|
|
@include('admin::components.prefix-tabs', ['prefixes' => $channel->prefixes, 'activePrefix' => $activePrefix])
|
|
|
|
<div class="bg-white rounded shadow overflow-hidden">
|
|
<table class="w-full text-sm">
|
|
<thead>
|
|
<tr class="border-b border-gray-200 text-left text-xs font-medium text-gray-500 uppercase tracking-wide">
|
|
<th class="px-4 py-3">Title</th>
|
|
<th class="px-4 py-3">Prefix</th>
|
|
<th class="px-4 py-3">Status</th>
|
|
<th class="px-4 py-3">Published</th>
|
|
<th class="px-4 py-3">Author</th>
|
|
<th class="px-4 py-3">Updated</th>
|
|
<th class="px-4 py-3"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@forelse($publications as $publication)
|
|
<tr class="hover:bg-gray-50">
|
|
<td class="px-4 py-3 font-medium text-gray-900 max-w-xs truncate">
|
|
<a href="{{ route('admin.posts.edit', $publication) }}" class="hover:text-indigo-600">
|
|
{{ $publication->title }}
|
|
</a>
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-400 font-mono text-xs">
|
|
{{ $publication->prefix ? '/'.$publication->prefix->slug : '—' }}
|
|
</td>
|
|
<td class="px-4 py-3">
|
|
<x-admin::post-status-badge :status="$publication->status" />
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-400 text-xs">
|
|
{{ $publication->published_at?->toDateString() ?? '—' }}
|
|
</td>
|
|
<td class="px-4 py-3 text-gray-500">{{ $publication->post->author->name ?? '—' }}</td>
|
|
<td class="px-4 py-3 text-gray-400 text-xs">{{ $publication->updated_at->diffForHumans() }}</td>
|
|
<td class="px-4 py-3 text-right whitespace-nowrap">
|
|
<a href="{{ route('admin.posts.edit', $publication) }}"
|
|
class="text-indigo-600 hover:underline mr-3">Edit</a>
|
|
<form method="POST" action="{{ route('admin.posts.destroy', $publication) }}"
|
|
class="inline" onsubmit="return confirm('Delete this publication?')">
|
|
@csrf @method('DELETE')
|
|
<button type="submit" class="text-red-500 hover:underline">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7" class="px-4 py-12 text-center text-gray-400">
|
|
No posts yet{{ $activePrefix ? ' in /'.$activePrefix->slug : '' }}.
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
@if($publications->hasPages())
|
|
<div class="px-4 py-3 border-t border-gray-100">{{ $publications->links() }}</div>
|
|
@endif
|
|
</div>
|
|
@endsection
|