phase two updates

This commit is contained in:
Mark Gregory
2026-07-24 09:45:41 +01:00
parent c2a19a16e6
commit 9204625c2f
114 changed files with 1480 additions and 1 deletions
@@ -0,0 +1,9 @@
<x-layouts.app :title="isset($record) ? __('Edit Faq') : __('Create Faq')">
<div class="mx-auto max-w-4xl space-y-6"><div><h1 class="text-2xl font-semibold">{{ isset($record) ? 'Edit' : 'Create' }} Faq</h1></div><form method="POST" action="{{ isset($record) ? route('administration.faq.update', $record) : route('administration.faq.store') }}" class="space-y-5 rounded-xl border border-zinc-200 bg-white p-6 dark:border-zinc-700 dark:bg-zinc-900">@csrf @isset($record) @method('PUT') @endisset
<div><label class="mb-1 block text-sm font-medium">Question</label><input type="text" name="question" value="{{ old('question', $record->question ?? '') }}" class="w-full rounded-lg border-zinc-300 dark:border-zinc-700 dark:bg-zinc-900">@error('question')<p class="text-sm text-red-600">{{ $message }}</p>@enderror</div>
<div><label class="mb-1 block text-sm font-medium">Answer</label><textarea name="answer" rows="8" class="w-full rounded-lg border-zinc-300 dark:border-zinc-700 dark:bg-zinc-900">{{ old('answer', $record->answer ?? '') }}</textarea>@error('answer')<p class="text-sm text-red-600">{{ $message }}</p>@enderror</div>
<div><label class="mb-1 block text-sm font-medium">Category</label><input type="text" name="category" value="{{ old('category', $record->category ?? '') }}" class="w-full rounded-lg border-zinc-300 dark:border-zinc-700 dark:bg-zinc-900">@error('category')<p class="text-sm text-red-600">{{ $message }}</p>@enderror</div>
<div><label class="mb-1 block text-sm font-medium">Sort Order</label><input type="number" name="sort_order" value="{{ old('sort_order', $record->sort_order ?? '') }}" class="w-full rounded-lg border-zinc-300 dark:border-zinc-700 dark:bg-zinc-900">@error('sort_order')<p class="text-sm text-red-600">{{ $message }}</p>@enderror</div>
<label class="flex items-center gap-2"><input type="checkbox" name="enabled" value="1" @checked(old('enabled', $record->enabled ?? true))><span>Enabled</span></label>
<div class="flex gap-3"><button class="rounded-lg bg-zinc-900 px-4 py-2 text-white dark:bg-white dark:text-zinc-900">Save</button><a href="{{ route('administration.faq.index') }}" class="rounded-lg border px-4 py-2">Cancel</a></div></form></div>
</x-layouts.app>
@@ -0,0 +1,5 @@
<x-layouts.app :title="__('Faq')">
<div class="space-y-6"><div class="flex items-center justify-between"><div><h1 class="text-2xl font-semibold">Faq</h1><p class="text-sm text-zinc-500">Manage faq content.</p></div><a href="{{ route('administration.faq.create') }}" class="rounded-lg bg-zinc-900 px-4 py-2 text-sm text-white dark:bg-white dark:text-zinc-900">Add new</a></div>
@if(session('status'))<div class="rounded-lg bg-emerald-50 p-3 text-emerald-800">{{ session('status') }}</div>@endif
<div class="overflow-hidden rounded-xl border border-zinc-200 bg-white dark:border-zinc-700 dark:bg-zinc-900"><table class="w-full text-sm"><thead class="bg-zinc-50 dark:bg-zinc-800"><tr><th class="px-4 py-3 text-left">Question</th><th class="px-4 py-3 text-left">Answer</th><th class="px-4 py-3 text-left">Category</th><th class="px-4 py-3 text-right">Actions</th></tr></thead><tbody class="divide-y divide-zinc-200 dark:divide-zinc-800">@forelse($records as $record)<tr><td class="px-4 py-3">{{ is_array($record->question) ? json_encode($record->question) : Str::limit((string) $record->question, 70) }}</td><td class="px-4 py-3">{{ is_array($record->answer) ? json_encode($record->answer) : Str::limit((string) $record->answer, 70) }}</td><td class="px-4 py-3">{{ is_array($record->category) ? json_encode($record->category) : Str::limit((string) $record->category, 70) }}</td><td class="px-4 py-3 text-right"><a class="mr-3 underline" href="{{ route('administration.faq.edit', $record) }}">Edit</a><form class="inline" method="POST" action="{{ route('administration.faq.destroy', $record) }}">@csrf @method('DELETE')<button class="text-red-600" onclick="return confirm('Delete this record?')">Delete</button></form></td></tr>@empty<tr><td colspan="4" class="px-4 py-10 text-center text-zinc-500">No records yet.</td></tr>@endforelse</tbody></table></div>{{ $records->links() }}</div>
</x-layouts.app>