mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-23 23:49:37 +00:00
b2d48d9a7f
- Moved thumnbail loading out of repo into ImageResizer. - Updated gallery and editor image handling to show errors where possible to indicate memory issues for resizing/thumbs. - Updated gallery to load image data in a per-image basis via edit form for more resiliant thumb/data fetching. Data was previously provided via gallery listing, which could be affected by failing generation of other images. - Updated image manager double click handling to be more pleasant and not flash away the edit form. - Updated editor handlers to use main URL when thumbs fail to load.
34 lines
1.3 KiB
PHP
34 lines
1.3 KiB
PHP
@if($warning ?? '')
|
|
<div class="image-manager-list-warning image-manager-warning px-m py-xs flex-container-row gap-xs items-center">
|
|
<div>@icon('warning')</div>
|
|
<div class="flex">{{ $warning }}</div>
|
|
</div>
|
|
@endif
|
|
@foreach($images as $index => $image)
|
|
<div>
|
|
<button component="event-emit-select"
|
|
option:event-emit-select:name="image"
|
|
option:event-emit-select:data="{{ json_encode($image) }}"
|
|
class="image anim fadeIn text-link"
|
|
style="animation-delay: {{ min($index * 10, 260) . 'ms' }};">
|
|
<img src="{{ $image->thumbs['gallery'] ?? '' }}"
|
|
alt="{{ $image->name }}"
|
|
role="none"
|
|
width="150"
|
|
height="150"
|
|
loading="lazy">
|
|
<div class="image-meta">
|
|
<span class="name">{{ $image->name }}</span>
|
|
<span class="date">{{ trans('components.image_uploaded', ['uploadedDate' => $image->created_at->format('Y-m-d')]) }}</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
@endforeach
|
|
@if(count($images) === 0)
|
|
<p class="m-m text-bigger italic text-muted">{{ trans('common.no_items') }}</p>
|
|
@endif
|
|
@if($hasMore)
|
|
<div class="load-more">
|
|
<button type="button" class="button small outline">{{ trans('components.image_load_more') }}</button>
|
|
</div>
|
|
@endif |