Merge pull request #12480 from snipe/fixes/ui_fix_for_user_files

Fixed UI bug where download button was missing for non-images
This commit is contained in:
snipe 2023-02-07 18:46:07 -08:00 committed by GitHub
commit e883a61a48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -396,6 +396,7 @@ return [
'alt_uploaded_image_thumbnail' => 'Uploaded thumbnail',
'placeholder_kit' => 'Select a kit',
'file_not_found' => 'File not found',
'preview_not_available' => '(no preview)',

View file

@ -868,13 +868,15 @@
</td>
<td>
@if ($file->filename)
@if ((Storage::exists('private_uploads/users/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('users'))))
@if (($file->filename) && (Storage::exists('private_uploads/users/'.$file->filename)))
@if (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>
@else
<i class="fa fa-times text-danger" aria-hidden="true"></i>
{{ trans('general.file_not_found') }}
{{ trans('general.preview_not_available') }}
@endif
@else
<i class="fa fa-times text-danger" aria-hidden="true"></i>
{{ trans('general.file_not_found') }}
@endif
</td>
<td>
@ -891,7 +893,7 @@
</td>
<td>
@if ($file->filename)
@if ((Storage::exists('private_uploads/users/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('users'))))
@if (Storage::exists('private_uploads/users/'.$file->filename))
<a href="{{ route('show/userfile', [$user->id, $file->id]) }}" class="btn btn-default">
<i class="fas fa-download" aria-hidden="true"></i>
<span class="sr-only">{{ trans('general.download') }}</span>