cms/resources/views/admin/menu/posts/list.blade.php

47 lines
1.7 KiB
PHP

@extends('admin.layouts.app')
@push('admin-app-styles')
<link rel="stylesheet" href="{{ asset('css/admin/page/post-list.css') }}">
@endpush
@section('admin-page-content')
<h2>{{ $pageHeader }}</h2>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>{{ trans('form.titles.title') }}</th>
<th>{{ trans('form.titles.author') }}</th>
<th>{{ trans('form.titles.created') }}</th>
<th>{{ trans('form.titles.updated') }}</th>
<th>{{ trans('form.titles.operations') }}</th>
</tr>
</thead>
<tbody>
@foreach($posts as $post)
<tr>
<td class="feature-image">
@if($post->featureImage)
<img src="{{ $post->featureImage->url }}" alt="{{ $post->featureImage->description }}">
@endif
</td>
<td><a href="{{ route($adminRouteNamePrefix . $resource . '.edit', [$resource => $post->id]) }}">{{ $post->title }}</a></td>
<td>{{ $post->author->email }}</td>
<td>{{ $post->created_at }}</td>
<td>{{ $post->updated_at }}</td>
<td>
<form action="{{ route($adminRouteNamePrefix . $resource . '.destroy', [$resource => $post->id]) }}" method="POST">
@method('delete')
@csrf
<button class="btn btn-danger">{{ trans('form.buttons.delete') }}</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
{!! $posts->links() !!}
@endsection