meobda-website/resources/views/admin/news/index.blade.php

48 lines
2.6 KiB
PHP

<x-layout.admin>
<x-card class="">
<x-slot:header class="bg-brand-600!">News Stories</x-slot:header>
<x-slot:body class="bg-white border border-brand-600">
<div class="text-right">
<x-form.button type="link" :href="route('admin.news.create')">New Story</x-form.button>
</div>
<div class="mt-3">
<x-table>
<x-slot:header>
<x-table.th></x-table.th>
<x-table.th>Headline</x-table.th>
<x-table.th>Status</x-table.th>
<x-table.th>Submission Date</x-table.th>
<x-table.th>Start Publication</x-table.th>
<x-table.th>Stop Publication</x-table.th>
</x-slot:header>
@foreach($stories as $story)
<tr>
<x-table.td class="flex gap-3 ">
<a href="{{route('admin.news.edit', $story)}}">
<x-heroicon-s-pencil-square class="size-5"/>
</a>
<x-modal-danger id="delete-{{$story->id}}" form-method="DELETE" form-action="{{ route('admin.news.destroy', $story) }}">
<x-slot:heading>Confirm Story Deletion</x-slot:heading>
<x-slot:affirmativeButton type="submit">Delete</x-slot:affirmativeButton>
<x-slot:openButton><x-heroicon-s-trash class="size-5" /></x-slot:openButton>
Do you really want to delete the story with the headline<br />{{ $story->headline }}?
</x-modal-danger>
</x-table.td>
<x-table.td>{{ $story->headline }}</x-table.td>
<x-table.td>
<x-badge-pill :color="$story->status->color()">
{{ $story->status->label() }}
</x-badge-pill>
</x-table.td>
<x-table.td>{{ $story->created_at->format('m/d/Y') }}</x-table.td>
<x-table.td>{{ $story->start_publication_date->format('m/d/Y') }}</x-table.td>
<x-table.td>{{ $story->stop_publication_date?->format('m/d/Y') }}</x-table.td>
</tr>
@endforeach
</x-table>
</div>
</x-slot:body>
</x-card>
</x-layout.admin>