Fixed #8747 - upload path for uploaded images

This commit is contained in:
snipe 2020-11-16 16:39:02 -08:00
parent 6e4ab5cd96
commit fbaf6e2494
2 changed files with 6 additions and 11 deletions

View file

@ -49,8 +49,7 @@ class ImageUploadRequest extends Request
$type = strtolower(class_basename(get_class($item)));
if (is_null($path)) {
$path = 'uploads/';
$path .= str_plural($type);
$path = str_plural($type);
if ($type == 'assetmodel') {
$path = 'models';

View file

@ -729,16 +729,12 @@
<div class="col-md-4">
@if ($asset->image)
@if (($asset->image) || (($asset->model) && ($asset->model->image!='')))
<div class="col-md-12 text-center" style="padding-bottom: 15px;">
<a href="{{ Storage::disk('public')->url('uploads/assets/'. $asset->image) }}" data-toggle="lightbox">
<img src="{{ Storage::disk('public')->url('uploads/assets/'. $asset->image) }}" class="assetimg img-responsive" alt="{{ $asset->getDisplayNameAttribute() }}">
</a>
</div>
@elseif (($asset->model) && ($asset->model->image!=''))
<div class="col-md-12 text-center" style="padding-bottom: 15px;">
<a href="{{ Storage::disk('public')->url('uploads/models/'.$asset->model->image) }}" data-toggle="lightbox">
<img src="{{ Storage::disk('public')->url('uploads/models/'.$asset->model->image) }}" class="assetimg img-responsive" alt="{{ $asset->getDisplayNameAttribute() }}">
<a href="{{ ($asset->getImageUrl()) ? $asset->getImageUrl() : null }}" data-toggle="lightbox">
<img src="{{ ($asset->getImageUrl()) ? $asset->getImageUrl() : null }}" class="assetimg img-responsive" alt="{{ $asset->getDisplayNameAttribute() }}">
</a>
</div>
@endif