Files
2026-09-02 17:08:57 +00:00

85 lines
3.7 KiB
PHP
Executable File

@extends('documentation::layouts.master')
@section('title', $document->title)
@section('content')
<div class="doc-page">
@include('documentation::partials.hero', [
'title' => $document->title,
'subtitle' =>
$document->summary ?:
'Controlled documentation record with versioning, attachments and Markdown rendering.',
'actions' => [
[
'label' => 'Edit document',
'url' => route('documentation.documents.edit', $document),
'class' => 'primary',
],
[
'label' => 'Back to documents',
'url' => route('documentation.documents.index'),
'class' => 'secondary',
],
],
])
@if (session('status'))
<div class="doc-alert">{{ session('status') }}</div>
@endif
<div class="doc-actions" style="margin-bottom:18px;justify-content:flex-end;">
<form method="POST"
action="{{ route('documentation.documents.destroy', $document) }}"
onsubmit="return confirm('Archive this document? Its files and attachments will be retained.')">
@csrf
@method('DELETE')
<button class="doc-button warning" type="submit">Archive document</button>
</form>
</div>
<section class="doc-card">
<div class="doc-card-header">
<div>
<strong>{{ $document->reference ?: 'Document' }}</strong>
<div class="doc-muted">Version {{ $document->version }} @if ($document->category)
· {{ $document->category->name }}
@endif
</div>
</div>
<span class="doc-badge {{ $document->status }}">{{ ucfirst($document->status) }}</span>
</div>
<div class="doc-card-body">
<article class="doc-content">{!! $document->rendered_body !!}</article>
</div>
</section>
@if ($document->attachment_name || $document->attachments->isNotEmpty())
<section class="doc-card" style="margin-top: 18px;">
<div class="doc-card-header"><strong>Attachments</strong></div>
<div class="doc-card-body">
<div class="doc-attachment-list">
@if ($document->attachment_name)
<div class="doc-attachment-item">
<div>
<a class="doc-link"
href="{{ route('documentation.documents.download', $document) }}">{{ $document->attachment_name }}</a>
<span class="doc-muted">Primary file</span>
</div>
</div>
@endif
@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>
</div>
@endforeach
</div>
</div>
</section>
@endif
</div>
@endsection