]> BookStack Code Mirror - bookstack/blob - resources/views/attachments/manager-list.blade.php
Continued implementation of attachment drag+drop
[bookstack] / resources / views / attachments / manager-list.blade.php
1 <div component="sortable-list" option:sortable-list:handle-selector=".handle">
2     @foreach($attachments as $attachment)
3         <div component="ajax-delete-row"
4              option:ajax-delete-row:url="{{ url('/attachments/' . $attachment->id) }}"
5              data-id="{{ $attachment->id }}"
6              data-drag-content="{{ json_encode(['text/html' => $attachment->htmlLink(), 'text/plain' => $attachment->markdownLink()]) }}"
7              class="card drag-card">
8             <div class="handle">@icon('grip')</div>
9             <div class="py-s">
10                 <a href="{{ $attachment->getUrl() }}" target="_blank">{{ $attachment->name }}</a>
11             </div>
12             <div class="flex-fill justify-flex-end">
13                 <button component="event-emit-select"
14                         option:event-emit-select:name="edit"
15                         option:event-emit-select:id="{{ $attachment->id }}"
16                         type="button"
17                         class="drag-card-action text-center text-primary">@icon('edit')</button>
18                 <div component="dropdown" class="flex-fill relative">
19                     <button refs="dropdown@toggle" type="button" class="drag-card-action text-center text-neg">@icon('close')</button>
20                     <div refs="dropdown@menu" class="dropdown-menu">
21                         <p class="text-neg small px-m mb-xs">{{ trans('entities.attachments_delete') }}</p>
22                         <button refs="ajax-delete-row@delete" type="button" class="text-primary small delete">{{ trans('common.confirm') }}</button>
23                     </div>
24                 </div>
25             </div>
26         </div>
27     @endforeach
28     @if (count($attachments) === 0)
29         <p class="small text-muted">
30             {{ trans('entities.attachments_no_files') }}
31         </p>
32     @endif
33 </div>