@extends('layouts.app') @section('content') @php $humanizeSectionKey = function ($key) { $key = (string) $key; if (preg_match('/^[a-z0-9_]+$/', $key)) { return \Illuminate\Support\Str::title(str_replace('_', ' ', $key)); } return $key; }; $existingSections = []; foreach (($model->content_sections ?? []) as $key => $body) { if (! is_string($body) && ! is_numeric($body)) continue; $body = trim((string) $body); if ($body === '') continue; $existingSections[] = ['heading' => $humanizeSectionKey($key), 'body' => $body]; } $oldSections = old('sections'); $sectionsForForm = is_array($oldSections) && count($oldSections) > 0 ? $oldSections : $existingSections; $errorFields = $errors->any() ? array_values(array_unique(array_map(function ($key) { return explode('.', $key)[0]; }, array_keys($errors->getMessages())))) : []; @endphp Edit Model Work through each section below — your progress is saved when you hit Save progress. @if(session('staff_notice')) {{ session('staff_notice') }} @endif @if($errors->any()) Please fix the following: @foreach($errors->all() as $error) {{ $error }} @endforeach @endif @csrf @method('PUT') 1 Basics 2 Source content 3 Teaching sections 4 AI Assistant 5 Media & publish {{-- 1. BASICS --}} Model title Model type @foreach($modelTypes as $type) model_type) === $type)>{{ ucfirst($type) }} @endforeach Sketchfab model link Paste a normal Sketchfab model URL. We convert it to embed URL automatically. Programme Species Body system Estimated study minutes Short summary {{ old('summary', $model->summary) }} {{-- 2. SOURCE CONTENT --}} Source content @if($model->source_text) {{ number_format(mb_strlen($model->source_text)) }} characters stored @endif Paste reference material below or upload a PDF/DOCX file. The app will read whatever you provide and generate appropriate headed sections from it. {{ old('pasted_source_text', $model->source_text) }} Or upload a PDF / DOCX file If you upload a file, the extracted text replaces what's in the paste box above. @if($model->source_file_name) Currently linked file: {{ $model->source_file_name }} Remove uploaded file and clear all source content @endif {{-- 3. TEACHING SECTIONS --}} Teaching content sections The app picks suitable headings based on your source content. You can fine-tune each section before saving. @if(empty($existingSections)) Generate sections @else Regenerate sections @endif @if(empty($sectionsForForm)) No teaching sections yet. Add source content on the previous tab and click Generate sections. @else @foreach($sectionsForForm as $i => $section) Section {{ $i + 1 }} heading Body {{ $section['body'] ?? '' }} @endforeach @endif {{-- 4. AI ASSISTANT --}} @include('staff.models._assistant_panel', ['model' => $model, 'assistantModes' => $assistantModes]) {{-- 5. MEDIA & PUBLISH --}} Supplementary video (optional) Paste any of: a YouTube/Vimeo/Media Hopper page URL, a direct video file URL, or a full <iframe> embed snippet. For Media Hopper videos, pasting the iframe embed code from the video's Share → Embed dialog is the most reliable option. Video URL or embed code {{ old('video_url', $model->video_url) }} Comment shown next to the video (optional) {{ old('video_comment', $model->video_comment) }} Audio narration (optional) @if($model->audio_path) Current audio uploaded. Remove current audio @endif show_learning_levels))> Show teaching content sections on the public model page published))> Publish model @include('staff.models._tabbed_form_script') @include('staff.models._assistant_panel_script') @endsection
Work through each section below — your progress is saved when you hit Save progress.
Please fix the following:
Paste a normal Sketchfab model URL. We convert it to embed URL automatically.
Paste reference material below or upload a PDF/DOCX file. The app will read whatever you provide and generate appropriate headed sections from it.
If you upload a file, the extracted text replaces what's in the paste box above.
Currently linked file: {{ $model->source_file_name }}
The app picks suitable headings based on your source content. You can fine-tune each section before saving.
No teaching sections yet. Add source content on the previous tab and click Generate sections.
Paste any of: a YouTube/Vimeo/Media Hopper page URL, a direct video file URL, or a full <iframe> embed snippet.
<iframe>
For Media Hopper videos, pasting the iframe embed code from the video's Share → Embed dialog is the most reliable option.
Current audio uploaded.