mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
delete libraryItem
This commit is contained in:
@@ -77,6 +77,13 @@ class NewsArticleForm extends Component
|
|||||||
return to_route('article.overview', ['country' => null]);
|
return to_route('article.overview', ['country' => null]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
$this->libraryItem->delete();
|
||||||
|
|
||||||
|
return to_route('article.overview', ['country' => null]);
|
||||||
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return view('livewire.news.form.news-article-form');
|
return view('livewire.news.form.news-article-form');
|
||||||
|
|||||||
@@ -2,7 +2,23 @@
|
|||||||
|
|
||||||
<div class="pb-5 flex flex-row justify-between">
|
<div class="pb-5 flex flex-row justify-between">
|
||||||
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('News Article') }}</h3>
|
<h3 class="text-lg font-medium leading-6 text-gray-200">{{ __('News Article') }}</h3>
|
||||||
<div class="flex flex-row space-x-2 items-center">
|
<div class="flex flex-row space-x-2 items-center justify-between">
|
||||||
|
<div x-data="{}">
|
||||||
|
@if($libraryItem->created_by === auth()->id())
|
||||||
|
<x-button
|
||||||
|
x-on:click="$wireui.confirmDialog({
|
||||||
|
icon: 'question',
|
||||||
|
title: '{{ __('Are your sure?') }}',
|
||||||
|
accept: {label: '{{ __('Yes') }}',
|
||||||
|
execute: () => $wire.delete()},
|
||||||
|
reject: {label: '{{ __('No, cancel') }}',
|
||||||
|
}})"
|
||||||
|
negative>
|
||||||
|
<i class="fa fa-thin fa-trash"></i>
|
||||||
|
{{ __('Delete') }}
|
||||||
|
</x-button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<x-button :href="route('article.overview', ['country' => null])">
|
<x-button :href="route('article.overview', ['country' => null])">
|
||||||
<i class="fa fa-thin fa-arrow-left"></i>
|
<i class="fa fa-thin fa-arrow-left"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user