64 lines
2.9 KiB
PHP
64 lines
2.9 KiB
PHP
@extends('admin::layouts.app')
|
|
|
|
@section('title', 'New Post')
|
|
|
|
@section('content')
|
|
<div class="flex items-center justify-between mb-6">
|
|
<h1 class="text-xl font-semibold text-gray-900">New Post</h1>
|
|
<a href="{{ route('admin.posts.index') }}" class="text-sm text-gray-500 hover:text-gray-700">← Posts</a>
|
|
</div>
|
|
|
|
<div class="max-w-xl">
|
|
<form method="POST" action="{{ route('admin.posts.store') }}">
|
|
@csrf
|
|
|
|
<div class="bg-white rounded shadow p-5 space-y-4">
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Title</label>
|
|
<input type="text" name="title" value="{{ old('title') }}" autofocus
|
|
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 @error('title') border-red-500 @enderror">
|
|
@error('title') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Prefix</label>
|
|
<select name="prefix_id"
|
|
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 @error('prefix_id') border-red-500 @enderror">
|
|
<option value="">— Select a prefix —</option>
|
|
@foreach($channel->prefixes as $prefix)
|
|
<option value="{{ $prefix->id }}" {{ old('prefix_id') == $prefix->id ? 'selected' : '' }}>
|
|
/{{ $prefix->slug }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
@error('prefix_id') <p class="mt-1 text-xs text-red-600">{{ $message }}</p> @enderror
|
|
@if($channel->prefixes->isEmpty())
|
|
<p class="mt-1 text-xs text-amber-600">
|
|
No prefixes assigned to this channel.
|
|
<a href="{{ route('admin.settings.channels.edit', $channel) }}" class="underline">Add some</a>.
|
|
</p>
|
|
@endif
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Status</label>
|
|
<select name="status"
|
|
class="w-full border border-gray-300 rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
|
<option value="draft" selected>Draft</option>
|
|
<option value="published">Published</option>
|
|
<option value="scheduled">Scheduled</option>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-4">
|
|
<button type="submit"
|
|
class="px-6 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-medium rounded">
|
|
Create & continue editing
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
@endsection
|