@extends('base') @section('content')
@include('chapters._breadcrumbs', ['chapter' => $chapter])
@if(userCan('page-create', $chapter)) {{ trans('entities.pages_new') }} @endif @if(userCan('chapter-update', $chapter)) {{ trans('common.edit') }} @endif @if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter)) @endif

{{ $chapter->name }}

{{ $chapter->description }}

@if(count($pages) > 0)

@foreach($pages as $page) @include('pages/list-item', ['page' => $page])
@endforeach
@else

{{ trans('entities.chapters_empty') }}

@if(userCan('page-create', $chapter)) {{ trans('entities.books_empty_create_page') }} @endif @if(userCan('page-create', $chapter) && userCan('book-update', $book))   -{{ trans('entities.books_empty_or') }}-    @endif @if(userCan('book-update', $book)) {{ trans('entities.books_empty_sort_current_book') }} @endif


@endif @include('partials.entity-meta', ['entity' => $chapter])
@if($book->restricted || $chapter->restricted)
@if($book->restricted)

@if(userCan('restrictions-manage', $book)) {{ trans('entities.books_permissions_active') }} @else {{ trans('entities.books_permissions_active') }} @endif

@endif @if($chapter->restricted) @if(userCan('restrictions-manage', $chapter)) {{ trans('entities.chapters_permissions_active') }} @else {{ trans('entities.chapters_permissions_active') }} @endif @endif
@endif @include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree])
@stop