Added checks and filetype display

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-10-17 00:09:09 +01:00
parent c49921f50f
commit 017884f843

View file

@ -995,7 +995,8 @@
<thead> <thead>
<tr> <tr>
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th> <th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.icon')}}</th>
<th data-visible="true" data-field="type" data-sortable="true">{{trans('general.file_type')}}</th>
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th> <th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th> <th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th> <th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
@ -1009,9 +1010,11 @@
@foreach ($user->uploads as $file) @foreach ($user->uploads as $file)
<tr> <tr>
<td> <td>
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i> <i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true" data-tooltip="true" data-title="{{ pathinfo('private_uploads/users/'.$file->filename, PATHINFO_EXTENSION) }}"></i>
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span> <span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
</td>
<td>
{{ pathinfo('private_uploads/users/'.$file->filename, PATHINFO_EXTENSION) }}
</td> </td>
<td> <td>
@if (($file->filename) && (Storage::exists('private_uploads/users/'.$file->filename))) @if (($file->filename) && (Storage::exists('private_uploads/users/'.$file->filename)))
@ -1045,7 +1048,7 @@
<span class="sr-only">{{ trans('general.download') }}</span> <span class="sr-only">{{ trans('general.download') }}</span>
</a> </a>
<a href="{{ route('show/userfile', [$user->id, $file->id, 'inline' => 'true']) }}" class="btn btn-sm btn-default" target="_blank"> <a href="{{ \App\Helpers\StorageHelper::allowSafeInline('private_uploads/users/'.$file->filename) ? route('show/userfile', [$user->id, $file->id, 'inline' => 'true']) : '#' }}" class="btn btn-sm btn-default{{ \App\Helpers\StorageHelper::allowSafeInline('private_uploads/users/'.$file->filename) ? '' : ' disabled' }}" target="_blank">
<x-icon type="external-link" /> <x-icon type="external-link" />
</a> </a>
@endif @endif