2020-12-17 12:31:18 -05:00
|
|
|
{{--This view display child pages in a list if pre-loaded onto a 'visible_pages' property,--}}
|
|
|
|
{{--To ensure that the pages have been loaded efficiently with permissions taken into account.--}}
|
|
|
|
<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}}">
|
2019-03-17 11:07:03 -04:00
|
|
|
<span class="icon text-chapter">@icon('chapter')</span>
|
2019-01-13 10:54:55 -05:00
|
|
|
<div class="content">
|
2019-03-17 11:07:03 -04:00
|
|
|
<h4 class="entity-list-item-name break-text">{{ $chapter->name }}</h4>
|
|
|
|
<div class="entity-item-snippet">
|
2022-05-18 08:18:21 -04:00
|
|
|
<p class="text-muted break-text">{{ $chapter->getExcerpt() }}</p>
|
2019-03-17 11:07:03 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
2020-12-17 12:31:18 -05:00
|
|
|
@if ($chapter->visible_pages->count() > 0)
|
2019-03-17 11:07:03 -04:00
|
|
|
<div class="chapter chapter-expansion">
|
|
|
|
<span class="icon text-chapter">@icon('page')</span>
|
2022-05-18 09:06:40 -04:00
|
|
|
<div component="chapter-contents" class="content">
|
|
|
|
<button type="button"
|
|
|
|
refs="chapter-contents@toggle"
|
2019-08-25 12:21:25 -04:00
|
|
|
aria-expanded="false"
|
2022-05-18 09:06:40 -04:00
|
|
|
class="text-muted chapter-contents-toggle">@icon('caret-right') <span>{{ trans_choice('entities.x_pages', $chapter->visible_pages->count()) }}</span></button>
|
|
|
|
<div refs="chapter-contents@list" class="inset-list chapter-contents-list">
|
2019-03-17 11:07:03 -04:00
|
|
|
<div class="entity-list-item-children">
|
2021-08-22 08:15:58 -04:00
|
|
|
@include('entities.list', ['entities' => $chapter->visible_pages])
|
2019-01-13 10:54:55 -05:00
|
|
|
</div>
|
2019-03-17 11:07:03 -04:00
|
|
|
</div>
|
2015-09-03 14:05:45 -04:00
|
|
|
</div>
|
2019-01-13 10:54:55 -05:00
|
|
|
</div>
|
2019-03-17 11:07:03 -04:00
|
|
|
@endif
|