]> BookStack Code Mirror - bookstack/blob - resources/views/entities/list-item.blade.php
respective book and chapter structure added.
[bookstack] / resources / views / entities / list-item.blade.php
1 @component('entities.list-item-basic', ['entity' => $entity, 'classes' => (($locked ?? false) ? 'disabled ' : '') . ($classes ?? '') ])
2
3 <div class="entity-item-snippet">
4
5     @if($locked ?? false)
6         <div class="text-warn my-xxs bold">
7             @icon('lock'){{ trans('entities.entity_select_lack_permission') }}
8         </div>
9     @endif
10
11     @if($showPath ?? false)
12         @if($entity->relationLoaded('book') && $entity->book)
13             <span class="text-book">{{ $entity->book->getShortName(42) }}</span>
14             @if($entity->relationLoaded('chapter') && $entity->chapter)
15                 <span class="text-muted entity-list-item-path-sep">@icon('chevron-right')</span> <span class="text-chapter">{{ $entity->chapter->getShortName(42) }}</span>
16             @endif
17         @endif
18     @endif
19
20     <p class="text-muted break-text">{{ $entity->preview_content ?? $entity->getExcerpt() }}</p>
21 </div>
22
23 @if(($showTags ?? false) && $entity->tags->count() > 0)
24     <div class="entity-item-tags mt-xs">
25         @include('entities.tag-list', ['entity' => $entity, 'linked' => false ])
26     </div>
27 @endif
28
29 @if(($showUpdatedBy ?? false) && $entity->relationLoaded('updatedBy') && $entity->updatedBy)
30     <small title="{{ $entity->updated_at->toDayDateTimeString() }}">
31         {!! trans('entities.meta_updated_name', [
32             'timeLength' => $entity->updated_at->diffForHumans(),
33             'user' => e($entity->updatedBy->name)
34         ]) !!}
35     </small>
36 @endif
37
38 @endcomponent