2018-08-04 19:07:32 +03:00
|
|
|
@stack($name . '_input_start')
|
2020-02-01 13:32:43 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
<div
|
2020-02-01 18:47:15 +03:00
|
|
|
class="form-group {{ $col }}{{ isset($attributes['required']) ? ' required' : '' }}{{ isset($attributes['readonly']) ? ' readonly' : '' }}{{ isset($attributes['disabled']) ? ' disabled' : '' }}"
|
2019-11-16 10:21:14 +03:00
|
|
|
:class="[{'has-error': errors.{{ $name }}}]">
|
2020-02-01 18:47:15 +03:00
|
|
|
@if (!empty($text))
|
|
|
|
{!! Form::label($name, $text, ['class' => 'form-control-label'])!!}
|
|
|
|
@endif
|
2018-08-04 19:07:32 +03:00
|
|
|
|
2020-12-30 11:11:39 +03:00
|
|
|
<div class="input-group input-group-merge">
|
2021-01-18 11:24:51 +03:00
|
|
|
<akaunting-dropzone-file-upload
|
2021-01-22 16:03:30 +03:00
|
|
|
text-drop-file="{{ trans('general.form.drop_file') }}"
|
|
|
|
text-choose-file="{{ trans('general.form.choose_file') }}"
|
2021-01-22 16:01:48 +03:00
|
|
|
|
2020-12-30 23:17:49 +03:00
|
|
|
@if (!empty($attributes['dropzone-class']))
|
|
|
|
class="{{ $attributes['dropzone-class'] }}"
|
|
|
|
@endif
|
2021-01-22 14:12:24 +03:00
|
|
|
|
2020-12-07 13:10:41 +03:00
|
|
|
@if (!empty($attributes['options']))
|
2021-01-22 14:12:24 +03:00
|
|
|
:options={{ json_encode($attributes['options']) }}
|
2020-12-07 13:10:41 +03:00
|
|
|
@endif
|
2021-01-22 14:12:24 +03:00
|
|
|
|
2021-01-29 17:25:28 +03:00
|
|
|
@if (!empty($attributes['preview']))
|
|
|
|
:preview={{ json_encode($attributes['preview']) }}
|
|
|
|
@endif
|
|
|
|
|
2020-12-07 13:10:41 +03:00
|
|
|
@if (!empty($attributes['multiple']))
|
|
|
|
multiple
|
|
|
|
@endif
|
2021-01-22 14:12:24 +03:00
|
|
|
|
|
|
|
@if (!empty($attributes['previewClasses']))
|
|
|
|
preview-classes="{{ $attributes['previewClasses'] }}"
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (!empty($attributes['url']))
|
|
|
|
url="{{ $attributes['url'] }}"
|
2021-01-17 17:58:34 +03:00
|
|
|
@endif
|
2021-01-22 14:12:24 +03:00
|
|
|
|
2021-01-30 21:20:46 +03:00
|
|
|
@if (!empty($value))
|
2021-01-30 22:07:01 +03:00
|
|
|
@php
|
|
|
|
$attachments = [];
|
|
|
|
@endphp
|
|
|
|
|
2021-01-30 21:20:46 +03:00
|
|
|
@if (is_array($value))
|
|
|
|
@foreach($value as $attachment)
|
|
|
|
@php
|
2021-01-30 22:07:01 +03:00
|
|
|
$attachments[] = [
|
2021-02-09 11:47:30 +03:00
|
|
|
'id' => $attachment->id,
|
2021-01-30 22:07:01 +03:00
|
|
|
'name' => $attachment->filename . '.' . $attachment->extension,
|
2021-02-09 11:47:30 +03:00
|
|
|
'path' => route('uploads.get', $attachment->id),
|
|
|
|
'type' => $attachment->mime_type,
|
|
|
|
'size' => $attachment->size,
|
|
|
|
'downloadPath' => route('uploads.download', $attachment->id),
|
2021-01-30 22:07:01 +03:00
|
|
|
];
|
2021-01-30 21:20:46 +03:00
|
|
|
@endphp
|
|
|
|
@endforeach
|
|
|
|
@elseif ($value instanceof \Plank\Mediable\Media)
|
|
|
|
@php
|
2021-01-30 22:07:01 +03:00
|
|
|
$attachments[] = [
|
2021-02-09 11:47:30 +03:00
|
|
|
'id' => $attachment->id,
|
2021-01-30 22:07:01 +03:00
|
|
|
'name' => $value->filename . '.' . $value->extension,
|
2021-02-09 11:47:30 +03:00
|
|
|
'path' => route('uploads.get', $value->id),
|
|
|
|
'type' => $attachment->mime_type,
|
|
|
|
'size' => $attachment->size,
|
|
|
|
'downloadPath' => false,
|
2021-01-30 22:07:01 +03:00
|
|
|
];
|
2021-01-30 21:20:46 +03:00
|
|
|
@endphp
|
|
|
|
@else
|
|
|
|
@php
|
2021-01-30 22:07:01 +03:00
|
|
|
$attachment = \Plank\Mediable\Media::find($value);
|
|
|
|
|
|
|
|
$attachments[] = [
|
2021-02-09 11:47:30 +03:00
|
|
|
'id' => $attachment->id,
|
2021-01-30 22:07:01 +03:00
|
|
|
'name' => $attachment->filename . '.' . $attachment->extension,
|
2021-02-09 11:47:30 +03:00
|
|
|
'path' => route('uploads.get', $attachment->id),
|
|
|
|
'type' => $attachment->mime_type,
|
|
|
|
'size' => $attachment->size,
|
|
|
|
'downloadPath' => false,
|
2021-01-30 22:07:01 +03:00
|
|
|
];
|
2021-01-30 21:20:46 +03:00
|
|
|
@endphp
|
|
|
|
@endif
|
2021-02-09 11:47:30 +03:00
|
|
|
|
2021-01-30 21:20:46 +03:00
|
|
|
:attachments="{{ json_encode($attachments) }}"
|
|
|
|
@endif
|
|
|
|
|
2020-12-07 13:10:41 +03:00
|
|
|
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name) }}"
|
2021-01-18 11:24:51 +03:00
|
|
|
></akaunting-dropzone-file-upload>
|
2019-11-16 10:21:14 +03:00
|
|
|
</div>
|
2018-08-04 19:07:32 +03:00
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
<div class="invalid-feedback d-block"
|
|
|
|
v-if="{{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.has("' . $name . '")' }}"
|
|
|
|
v-html="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}">
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-01 13:32:43 +03:00
|
|
|
|
2018-08-04 19:07:32 +03:00
|
|
|
@stack($name . '_input_end')
|