Show accessory image on view page

This commit is contained in:
snipe 2019-05-24 18:22:57 -07:00
parent 5db7a7c196
commit 237acdcff0
2 changed files with 23 additions and 5 deletions

View file

@ -111,6 +111,15 @@ class SettingsServiceProvider extends ServiceProvider
return url('/').'/uploads/companies/';
});
// Accessories paths and URLs
\App::singleton('accessories_upload_path', function(){
return public_path('/uploads/accessories/');
});
\App::singleton('accessories_upload_url', function(){
return url('/').'/uploads/accessories/';
});
// Set the monetary locale to the configured locale to make helper::parseFloat work.

View file

@ -88,13 +88,22 @@
<!-- side address column -->
<div class="col-md-3">
@if ($accessory->image!='')
<div class="col-md-12 text-center" style="padding-bottom: 15px;">
<img src="{{ app('accessories_upload_url') }}/{{ $accessory->image }}" class="img-responsive img-thumbnail" alt="{{ $accessory->name }}">
</div>
@endif
<div class="text-center">
@can('checkout', \App\Models\Accessory::class)
<a href="{{ route('checkout/accessory', $accessory->id) }}" style="margin-right:5px;" class="btn btn-info btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
@endcan
</div>
<h4>{{ trans('admin/accessories/general.about_accessories_title') }}</h4>
<p>{{ trans('admin/accessories/general.about_accessories_text') }} </p>
<div class="text-center">
@can('checkout', \App\Models\Accessory::class)
<a href="{{ route('checkout/accessory', $accessory->id) }}" style="margin-right:5px;" class="btn btn-info btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
@endcan
</div>
</div>
</div>