Merge pull request #1842 from cuneytsenturk/master
File group drag and drop developement
This commit is contained in:
@ -45,17 +45,24 @@
|
||||
@foreach($value as $attachment)
|
||||
@php
|
||||
$attachments[] = [
|
||||
'id' => $attachment->id,
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'downloadPath' => route('uploads.download', $attachment->id)
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'type' => $attachment->mime_type,
|
||||
'size' => $attachment->size,
|
||||
'downloadPath' => route('uploads.download', $attachment->id),
|
||||
];
|
||||
@endphp
|
||||
@endforeach
|
||||
@elseif ($value instanceof \Plank\Mediable\Media)
|
||||
@php
|
||||
$attachments[] = [
|
||||
'id' => $value->id,
|
||||
'name' => $value->filename . '.' . $value->extension,
|
||||
'path' => route('uploads.get', $value->id)
|
||||
'path' => route('uploads.get', $value->id),
|
||||
'type' => $value->mime_type,
|
||||
'size' => $value->size,
|
||||
'downloadPath' => false,
|
||||
];
|
||||
@endphp
|
||||
@else
|
||||
@ -63,12 +70,16 @@
|
||||
$attachment = \Plank\Mediable\Media::find($value);
|
||||
|
||||
$attachments[] = [
|
||||
'id' => $attachment->id,
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id)
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'type' => $attachment->mime_type,
|
||||
'size' => $attachment->size,
|
||||
'downloadPath' => false,
|
||||
];
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
|
||||
:attachments="{{ json_encode($attachments) }}"
|
||||
@endif
|
||||
|
||||
|
@ -38,9 +38,9 @@
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'form-file']) }}
|
||||
|
||||
{{ Form::selectGroup('document_id', trans_choice('general.bills', 1), 'file-invoice', [], null, ['disabled' => 'true']) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], null, 'col-md-12') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -57,19 +57,12 @@
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
|
||||
|
||||
@if ($payment->attachment)
|
||||
<div class="col-md-6">
|
||||
@php $file = $payment->attachment; @endphp
|
||||
@include('partials.media.file')
|
||||
</div>
|
||||
@else
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'form-file']) }}
|
||||
@endif
|
||||
|
||||
@if ($payment->bill)
|
||||
{{ Form::textGroup('document', trans_choice('general.bills', 1), 'file-invoice', ['disabled' => 'true'], $payment->bill->document_number) }}
|
||||
{{ Form::hidden('document_id', $payment->bill->id) }}
|
||||
@endif
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], $payment->attachment, 'col-md-12') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -38,9 +38,9 @@
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file', []) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'form-file']) }}
|
||||
|
||||
{{ Form::selectGroup('document_id', trans_choice('general.invoices', 1), 'file-invoice', [], null, ['disabled' => 'true']) }}
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], null, 'col-md-12') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -57,19 +57,12 @@
|
||||
|
||||
{{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }}
|
||||
|
||||
@if ($revenue->attachment)
|
||||
<div class="col-md-6">
|
||||
@php $file = $revenue->attachment; @endphp
|
||||
@include('partials.media.file')
|
||||
</div>
|
||||
@else
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'form-file']) }}
|
||||
@endif
|
||||
|
||||
@if ($revenue->invoice)
|
||||
{{ Form::textGroup('document', trans_choice('general.invoices', 1), 'file-invoice', ['disabled' => 'true'], $revenue->invoice->document_number) }}
|
||||
{{ Form::hidden('document_id', $revenue->invoice->id) }}
|
||||
@endif
|
||||
|
||||
{{ Form::fileGroup('attachment', trans('general.attachment'), '', ['dropzone-class' => 'w-100', 'multiple' => 'multiple', 'options' => ['acceptedFiles' => $file_types]], $revenue->attachment, 'col-md-12') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user