2022-11-16 00:04:46 +08:00
|
|
|
<div component="image-picker"
|
|
|
|
option:image-picker:default-image="{{ $defaultImage }}"
|
|
|
|
class="image-picker @if($errors->has($name)) has-error @endif">
|
2016-12-24 23:21:19 +08:00
|
|
|
|
2019-02-03 21:45:45 +08:00
|
|
|
<div class="grid half">
|
|
|
|
<div class="text-center">
|
2022-11-16 00:04:46 +08:00
|
|
|
<img refs="image-picker@image"
|
|
|
|
@if($currentImage && $currentImage !== 'none') src="{{$currentImage}}" @else src="{{$defaultImage}}" @endif
|
|
|
|
class="{{$imageClass}} @if($currentImage=== 'none') none @endif" alt="{{ trans('components.image_preview') }}">
|
2019-02-03 21:45:45 +08:00
|
|
|
</div>
|
|
|
|
<div class="text-center">
|
2022-11-16 00:04:46 +08:00
|
|
|
<input refs="image-picker@image-input" type="file" class="custom-file-input" accept="image/*" name="{{ $name }}" id="{{ $name }}">
|
2019-05-04 22:48:15 +08:00
|
|
|
<label for="{{ $name }}" class="button outline">{{ trans('components.image_select_image') }}</label>
|
2022-11-16 00:04:46 +08:00
|
|
|
<input refs="image-picker@reset-input" type="hidden" name="{{ $name }}_reset" value="true" disabled="disabled">
|
2019-05-04 22:48:15 +08:00
|
|
|
@if(isset($removeName))
|
2022-11-16 00:04:46 +08:00
|
|
|
<input refs="image-picker@remove-input" type="hidden" name="{{ $removeName }}" value="{{ $removeValue }}" disabled="disabled">
|
2019-05-04 22:48:15 +08:00
|
|
|
@endif
|
|
|
|
|
2019-02-03 21:45:45 +08:00
|
|
|
<br>
|
2022-11-16 00:04:46 +08:00
|
|
|
<button refs="image-picker@reset-button" class="text-button text-muted" type="button">{{ trans('common.reset') }}</button>
|
2016-12-24 23:21:19 +08:00
|
|
|
|
2019-05-04 22:48:15 +08:00
|
|
|
@if(isset($removeName))
|
2019-02-03 21:45:45 +08:00
|
|
|
<span class="sep">|</span>
|
2022-11-16 00:04:46 +08:00
|
|
|
<button refs="image-picker@remove-button" class="text-button text-muted" type="button">{{ trans('common.remove') }}</button>
|
2019-02-03 21:45:45 +08:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-12-24 23:21:19 +08:00
|
|
|
|
2019-05-04 22:48:15 +08:00
|
|
|
@if($errors->has($name))
|
|
|
|
<div class="text-neg text-small">{{ $errors->first($name) }}</div>
|
|
|
|
@endif
|
|
|
|
|
2017-12-07 01:32:29 +08:00
|
|
|
</div>
|