Added Documentation
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
@csrf
|
||||
@if($category->exists)
|
||||
@method('PUT')
|
||||
@endif
|
||||
<div class="doc-form-grid">
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="name">Name</label>
|
||||
<input class="doc-input" id="name" name="name" value="{{ old('name', $category->name) }}" required maxlength="150">
|
||||
@error('name') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="slug">Slug</label>
|
||||
<input class="doc-input" id="slug" name="slug" value="{{ old('slug', $category->slug) }}" maxlength="180" placeholder="Auto-generated when blank">
|
||||
@error('slug') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="icon">Icon</label>
|
||||
<input class="doc-input" id="icon" name="icon" value="{{ old('icon', $category->icon) }}" maxlength="80" placeholder="book-open, file-check, shield">
|
||||
@error('icon') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="colour">Colour</label>
|
||||
<input class="doc-input" id="colour" name="colour" value="{{ old('colour', $category->colour ?: 'emerald') }}" required maxlength="32">
|
||||
@error('colour') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="sort_order">Sort order</label>
|
||||
<input class="doc-input" id="sort_order" name="sort_order" type="number" min="0" value="{{ old('sort_order', $category->sort_order ?: 0) }}">
|
||||
@error('sort_order') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field" style="display:flex;align-items:end;">
|
||||
<label><input type="checkbox" name="is_active" value="1" @checked(old('is_active', $category->is_active ?? true))> Active category</label>
|
||||
</div>
|
||||
<div class="doc-field full">
|
||||
<label class="doc-label" for="description">Description</label>
|
||||
<textarea class="doc-textarea" id="description" name="description" style="min-height:140px;">{{ old('description', $category->description) }}</textarea>
|
||||
@error('description') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="doc-actions" style="margin-top:22px;">
|
||||
<button class="doc-button dark" type="submit">Save category</button>
|
||||
<a class="doc-button light" href="{{ route('documentation.categories.index') }}">Cancel</a>
|
||||
</div>
|
||||
@@ -0,0 +1,109 @@
|
||||
@csrf
|
||||
@if($document->exists)
|
||||
@method('PUT')
|
||||
@endif
|
||||
|
||||
<div class="doc-form-grid">
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="title">Title</label>
|
||||
<input class="doc-input" id="title" name="title" value="{{ old('title', $document->title) }}" required maxlength="220">
|
||||
@error('title') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="slug">Slug</label>
|
||||
<input class="doc-input" id="slug" name="slug" value="{{ old('slug', $document->slug) }}" maxlength="240" placeholder="Auto-generated when blank">
|
||||
@error('slug') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="documentation_category_id">Category</label>
|
||||
<select class="doc-select" id="documentation_category_id" name="documentation_category_id">
|
||||
<option value="">No category</option>
|
||||
@foreach($categories as $category)
|
||||
<option value="{{ $category->id }}" @selected((string) old('documentation_category_id', $document->documentation_category_id) === (string) $category->id)>{{ $category->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('documentation_category_id') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="status">Status</label>
|
||||
<select class="doc-select" id="status" name="status" required>
|
||||
@foreach($statuses as $value => $label)
|
||||
<option value="{{ $value }}" @selected(old('status', $document->status) === $value)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('status') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="version">Version</label>
|
||||
<input class="doc-input" id="version" name="version" value="{{ old('version', $document->version ?: '1.0.0') }}" required maxlength="50">
|
||||
@error('version') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field">
|
||||
<label class="doc-label" for="reference">Reference</label>
|
||||
<input class="doc-input" id="reference" name="reference" value="{{ old('reference', $document->reference) }}" maxlength="100" placeholder="SOP-001, POL-002, etc.">
|
||||
@error('reference') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field full">
|
||||
<label class="doc-label" for="summary">Summary</label>
|
||||
<input class="doc-input" id="summary" name="summary" value="{{ old('summary', $document->summary) }}" maxlength="500">
|
||||
@error('summary') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field full">
|
||||
<label class="doc-label" for="body">Document body</label>
|
||||
<div class="doc-editor" data-documentation-editor>
|
||||
<div class="doc-editor-toolbar" aria-label="Markdown editor controls">
|
||||
<button type="button" data-md-before="## " data-md-after="" title="Heading">H2</button>
|
||||
<button type="button" data-md-before="**" data-md-after="**" title="Bold"><strong>B</strong></button>
|
||||
<button type="button" data-md-before="_" data-md-after="_" title="Italic"><em>I</em></button>
|
||||
<button type="button" data-md-before="> " data-md-after="" title="Quote">Quote</button>
|
||||
<button type="button" data-md-before="- " data-md-after="" title="Bullet list">List</button>
|
||||
<button type="button" data-md-before="1. " data-md-after="" title="Numbered list">1.</button>
|
||||
<button type="button" data-md-before="[" data-md-after="](https://)" title="Link">Link</button>
|
||||
<button type="button" data-md-before="`" data-md-after="`" title="Inline code">Code</button>
|
||||
<button type="button" data-md-before="```php " data-md-after=" ```" title="Code block">Code block</button>
|
||||
<button type="button" data-md-before="| Column | Column | | --- | --- | | Value | Value |" data-md-after="" title="Table">Table</button>
|
||||
</div>
|
||||
<textarea class="doc-textarea" id="body" name="body" data-markdown-textarea>{{ old('body', $document->body) }}</textarea>
|
||||
<p class="doc-muted editor-help">Markdown is supported, including fenced code blocks such as <code>```php</code>, tables, lists, links, and headings.</p>
|
||||
</div>
|
||||
@error('body') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field full">
|
||||
<label class="doc-label" for="attachment">Primary attachment</label>
|
||||
<input class="doc-input" id="attachment" name="attachment" type="file">
|
||||
<p class="doc-muted">Primary Markdown files can be imported into the document body when the body is blank.</p>
|
||||
@if($document->attachment_name)
|
||||
<p class="doc-muted">Current primary file: <a class="doc-link" href="{{ route('documentation.documents.download', $document) }}">{{ $document->attachment_name }}</a></p>
|
||||
<label><input type="checkbox" name="remove_attachment" value="1"> Remove current primary attachment</label>
|
||||
@endif
|
||||
@error('attachment') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
</div>
|
||||
<div class="doc-field full">
|
||||
<label class="doc-label" for="attachments">Additional attachments</label>
|
||||
<input class="doc-input" id="attachments" name="attachments[]" type="file" multiple>
|
||||
<p class="doc-muted">Attach supporting files such as PDFs, screenshots, spreadsheets, Word documents, Markdown, CSV, and images.</p>
|
||||
@error('attachments') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
@error('attachments.*') <div class="doc-error">{{ $message }}</div> @enderror
|
||||
|
||||
@if($document->exists && $document->attachments->isNotEmpty())
|
||||
<div class="doc-attachment-list" style="margin-top: 14px;">
|
||||
@foreach($document->attachments as $attachment)
|
||||
<div class="doc-attachment-item">
|
||||
<div>
|
||||
<a class="doc-link" href="{{ route('documentation.documents.attachments.download', [$document, $attachment]) }}">{{ $attachment->original_name }}</a>
|
||||
<span class="doc-muted">{{ $attachment->size_label }}</span>
|
||||
</div>
|
||||
<button class="doc-button danger" type="submit" form="delete-attachment-{{ $attachment->id }}">Remove</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="doc-field full">
|
||||
<label><input type="checkbox" name="is_featured" value="1" @checked(old('is_featured', $document->is_featured))> Feature this document on the dashboard</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="doc-actions" style="margin-top:22px;">
|
||||
<button class="doc-button dark" type="submit">Save document</button>
|
||||
<a class="doc-button light" href="{{ route('documentation.documents.index') }}">Cancel</a>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<section class="doc-hero">
|
||||
<div>
|
||||
<p class="doc-eyebrow">{{ $eyebrow ?? 'Documentation Suite' }}</p>
|
||||
<h1>{{ $title ?? 'Documentation' }}</h1>
|
||||
<p>{{ $subtitle ?? 'Manage controlled documents, policies, guides, files, and operational knowledge in one professional workspace.' }}</p>
|
||||
<div class="doc-actions">
|
||||
<a class="doc-button primary" href="{{ route('documentation.documents.create') }}">Create document</a>
|
||||
<a class="doc-button secondary" href="{{ route('documentation.categories.index') }}">Manage categories</a>
|
||||
<a class="doc-button secondary" href="{{ route('documentation.documents.index') }}">Document register</a>
|
||||
</div>
|
||||
</div>
|
||||
<div aria-hidden="true" style="width:140px;height:140px;border-radius:32px;background:rgba(255,255,255,.16);display:grid;place-items:center;border:1px solid rgba(255,255,255,.26);font-size:58px;font-weight:900;">D</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user