mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-06 12:02:45 +03:00
Updated attachment links to have dropdown for open type
- Allows easier accessibility of inline attachments. - Introduces a new split-icon-list-item thingy to support such cases where only part of the button is actually linked.
This commit is contained in:
@@ -1,10 +1,27 @@
|
||||
<div component="attachments-list">
|
||||
@foreach($attachments as $attachment)
|
||||
<div class="attachment icon-list">
|
||||
<a class="icon-list-item py-xs attachment-{{ $attachment->external ? 'link' : 'file' }}" href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif>
|
||||
<span class="icon">@icon($attachment->external ? 'export' : 'file')</span>
|
||||
<span>{{ $attachment->name }}</span>
|
||||
</a>
|
||||
<div class="split-icon-list-item attachment-{{ $attachment->external ? 'link' : 'file' }}">
|
||||
<a href="{{ $attachment->getUrl() }}" @if($attachment->external) target="_blank" @endif>
|
||||
<div class="icon">@icon($attachment->external ? 'export' : 'file')</div>
|
||||
<div class="label">{{ $attachment->name }}</div>
|
||||
</a>
|
||||
@if(!$attachment->external)
|
||||
<div component="dropdown" class="icon-list-item-dropdown">
|
||||
<button refs="dropdown@toggle" type="button" class="icon-list-item-dropdown-toggle">@icon('caret-down')</button>
|
||||
<ul refs="dropdown@menu" class="dropdown-menu" role="menu">
|
||||
<a href="{{ $attachment->getUrl(false) }}" class="icon-item">
|
||||
@icon('download')
|
||||
<div>{{ trans('common.download') }}</div>
|
||||
</a>
|
||||
<a href="{{ $attachment->getUrl(true) }}" target="_blank" class="icon-item">
|
||||
@icon('export')
|
||||
<div>{{ trans('common.open_in_tab') }}</div>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
Reference in New Issue
Block a user