]> BookStack Code Mirror - bookstack/blob - resources/views/chapters/parts/list-item.blade.php
Made chapter toggle in book sidebar nav more consistent
[bookstack] / resources / views / chapters / parts / list-item.blade.php
1 {{--This view display child pages in a list if pre-loaded onto a 'visible_pages' property,--}}
2 {{--To ensure that the pages have been loaded efficiently with permissions taken into account.--}}
3 <a href="{{ $chapter->getUrl() }}" class="chapter entity-list-item @if($chapter->visible_pages->count() > 0) has-children @endif" data-entity-type="chapter" data-entity-id="{{$chapter->id}}">
4     <span class="icon text-chapter">@icon('chapter')</span>
5     <div class="content">
6         <h4 class="entity-list-item-name break-text">{{ $chapter->name }}</h4>
7         <div class="entity-item-snippet">
8             <p class="text-muted break-text">{{ $chapter->getExcerpt() }}</p>
9         </div>
10     </div>
11 </a>
12 @if ($chapter->visible_pages->count() > 0)
13     <div class="chapter chapter-expansion">
14         <span class="icon text-chapter">@icon('page')</span>
15         <div component="chapter-contents" class="content">
16             <button type="button"
17                     refs="chapter-contents@toggle"
18                     aria-expanded="false"
19                     class="text-muted chapter-contents-toggle">@icon('caret-right') <span>{{ trans_choice('entities.x_pages', $chapter->visible_pages->count()) }}</span></button>
20             <div refs="chapter-contents@list" class="inset-list chapter-contents-list">
21                 <div class="entity-list-item-children">
22                     @include('entities.list', ['entities' => $chapter->visible_pages])
23                 </div>
24             </div>
25         </div>
26     </div>
27 @endif