@extends('base') @section('content')
@if(userCan('page-create', $chapter)) New Page @endif @if(userCan('chapter-update', $chapter)) Edit @endif @if(userCan('chapter-delete', $chapter)) Delete @endif

{{ $chapter->name }}

{{ $chapter->description }}

@if(count($chapter->pages) > 0)

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

No pages are currently in this chapter.

Create a new page   -or-    Sort the current book


@endif

Created {{$chapter->created_at->diffForHumans()}} @if($chapter->createdBy) by {{$chapter->createdBy->name}} @endif
Last Updated {{$chapter->updated_at->diffForHumans()}} @if($chapter->updatedBy) by {{$chapter->updatedBy->name}} @endif

@include('pages/sidebar-tree-list', ['book' => $book, 'sidebarTree' => $sidebarTree])
@stop