@extends('components.app-layout') @section('title', $parent ? $parent->name : 'Document Categories') @section('content')
@if($parent) @endif

@if($parent)
{{ $parent->name }} ({{ $parent->isFolder() ? 'Folder' : 'Category' }})
@else Document Categories @endif

@if($parent) {{ $parent->description ?: 'Manage folders and documents in this ' . ($parent->isFolder() ? 'folder' : 'category') }} @else Organize your documents into categories for better management @endif

@forelse($categories as $category)

{{ $category->name }}

{{ $category->isFolder() ? 'Folder' : 'Category' }} {{ $category->documents_count }} docs @if($category->children->count() > 0) {{ $category->children->count() }} {{ $category->isFolder() ? 'items' : 'folders' }} @endif
@if($category->is_active) @else @endif
@if($category->description)

{{ Str::limit($category->description, 120) }}

@endif @if($category->path && $category->depth > 0)
Path: {{ Str::limit($category->path, 50) }}
@endif
@if($category->isFolder()) @else @endif
@csrf @method('PATCH')
@if($category->documents_count == 0)
@csrf @method('DELETE')
@endif
@empty

No categories yet

Get started by creating your first document category.

Create Category
@endforelse
@if($categories->hasPages())
{{ $categories->links() }}
@endif @if($parent && $parent->documents->count() > 0)

Documents in {{ $parent->name }}

View all in Documents
@foreach($parent->documents->take(10) as $document) @endforeach
Document Size Prints Status Uploaded Actions
{{ $document->title }}
{{ $document->file_name }}
{{ $document->file_size_formatted }} {{ $document->print_count }} @if($document->is_active) Active @else Inactive @endif
{{ $document->created_at->format('M d, Y') }}
by {{ $document->uploader->name }}
@if($document->canBePrinted())
@csrf
@endif
@if($parent->documents->count() > 10) @endif
@elseif($parent && $parent->documents->count() == 0)

No documents yet

This {{ $parent->isFolder() ? 'folder' : 'category' }} doesn't have any documents yet.

@endif
@endsection