From 16fcc6dc444b20c28aab9432f2ba620a69f38978 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 7 Feb 2023 18:40:00 -0800 Subject: [PATCH] Fixed UI bug where download button was missing for non-images Signed-off-by: snipe --- resources/lang/en/general.php | 1 + resources/views/users/view.blade.php | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php index a2c7e367d9..e071124a05 100644 --- a/resources/lang/en/general.php +++ b/resources/lang/en/general.php @@ -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)', diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index 3fb3b9a58c..cd9757854a 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -868,13 +868,15 @@ - @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'))) @else - - {{ trans('general.file_not_found') }} + {{ trans('general.preview_not_available') }} @endif + @else + + {{ trans('general.file_not_found') }} @endif @@ -891,7 +893,7 @@ @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)) {{ trans('general.download') }}