mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Handle missing userfiles more gracefully
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
2a8851bbd7
commit
78dca7fd32
|
@ -390,7 +390,8 @@ return [
|
||||||
'start_date' => 'Start Date',
|
'start_date' => 'Start Date',
|
||||||
'end_date' => 'End Date',
|
'end_date' => 'End Date',
|
||||||
'alt_uploaded_image_thumbnail' => 'Uploaded thumbnail',
|
'alt_uploaded_image_thumbnail' => 'Uploaded thumbnail',
|
||||||
'placeholder_kit' => 'Select a kit'
|
'placeholder_kit' => 'Select a kit',
|
||||||
|
'file_not_found' => 'File not found',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -869,16 +869,19 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->filename)
|
@if ($file->filename)
|
||||||
@if ( Helper::checkUploadIsImage($file->get_src('users')))
|
@if ((Storage::exists('private_uploads/users/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('users'))))
|
||||||
<a href="{{ route('show/userfile', ['userId' => $user->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show/userfile', ['userId' => $user->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
<a href="{{ route('show/userfile', ['userId' => $user->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show/userfile', ['userId' => $user->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||||
|
@else
|
||||||
|
<i class="fa fa-times text-danger" aria-hidden="true"></i>
|
||||||
|
{{ trans('general.file_not_found') }}
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ $file->filename }}
|
{{ $file->filename }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td data-value="{{ (Storage::exists('private_uploads/users/'.$file->filename)) ? Storage::size('private_uploads/users/'.$file->filename) : '' }}">
|
||||||
{{ Helper::formatFilesizeUnits(Storage::size('private_uploads/users/'.$file->filename)) }}
|
{{ (Storage::exists('private_uploads/users/'.$file->filename)) ? Helper::formatFilesizeUnits(Storage::size('private_uploads/users/'.$file->filename)) : '' }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
@ -888,10 +891,12 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if ($file->filename)
|
@if ($file->filename)
|
||||||
<a href="{{ route('show/userfile', [$user->id, $file->id]) }}" class="btn btn-default">
|
@if ((Storage::exists('private_uploads/users/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('users'))))
|
||||||
<i class="fas fa-download" aria-hidden="true"></i>
|
<a href="{{ route('show/userfile', [$user->id, $file->id]) }}" class="btn btn-default">
|
||||||
<span class="sr-only">{{ trans('general.download') }}</span>
|
<i class="fas fa-download" aria-hidden="true"></i>
|
||||||
</a>
|
<span class="sr-only">{{ trans('general.download') }}</span>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $file->created_at }}</td>
|
<td>{{ $file->created_at }}</td>
|
||||||
|
|
Loading…
Reference in a new issue