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

56 lines
2.3 KiB
PHP

<x-layout.admin>
<x-card class="max-w-3xl mx-auto">
<x-slot:header class="bg-brand-600!">Create News Story</x-slot:header>
<x-slot:body class="bg-white border border-brand-600">
@if($errors->any())
@foreach($errors->all() as $error)
<x-alert color="red">{{ $error }}</x-alert>
@endforeach
@endif
<x-form method="POST" :action="route('admin.news.store')">
<div>
<x-form.input name="headline" label="Headline"/>
</div>
<div class="mt-3">
<x-form.textarea name="body" label="Body"/>
</div>
<div class="mt-3">
<x-form.radio-group name="active">
<x-slot:label>Status</x-slot:label>
<x-form.radio-group-item id="active" value="true" checked>Active</x-form.radio-group-item>
<x-form.radio-group-item id="draft" value="false">Draft</x-form.radio-group-item>
</x-form.radio-group>
</div>
<div x-data="{ showStartDate: false }" class="mt-3">
<x-form.checkbox name="scheduleStart" x-model="showStartDate" value="true"
label="Schedule Publication"/>
<x-form.input
type="date"
name="start_publication_date"
label=""
:value="now()->toDateString()"
x-show="showStartDate"
x-cloak
/>
</div>
<div x-data="{ showEndDate: false }" class="mt-3">
<x-form.checkbox name="scheduleEnd" x-model="showEndDate" value="true" label="Schedule Removal"/>
<x-form.input
type="date"
name="stop_publication_date"
label=""
x-show="showEndDate"
x-cloak
/>
</div>
<div class="mt-3 text-right">
<x-form.button type="submit">Save Story</x-form.button>
</div>
</x-form>
</x-slot:body>
</x-card>
</x-layout.admin>