İmport page design
This commit is contained in:
@@ -3,30 +3,48 @@
|
||||
{{ trans('import.title', ['type' => $title_type]) }}
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="favorite"
|
||||
title="{{ trans('import.title', ['type' => $title_type]) }}"
|
||||
icon="import_export"
|
||||
url="{{ route('import.create', ['group' => $group, 'type' => $type]) }}"
|
||||
></x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
<div class="card">
|
||||
<x-form id="import" :route="$form_params['route']" :url="$form_params['url']">
|
||||
<div class="card-body mt-8">
|
||||
<div class="border-t-4 border-orange-300 rounded-b-lg text-orange-700 px-4 py-3 shadow-md" role="alert">
|
||||
<div class="flex">
|
||||
<div>
|
||||
{!! trans('import.limitations', ['extensions' => strtoupper(config('excel.imports.extensions')),
|
||||
'row_limit' => config('excel.imports.row_limit')
|
||||
])
|
||||
!!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col lg:flex-row">
|
||||
<div class="hidden lg:flex w-4/12 ltr:-ml-10 rtl:-mr-10 ltr:mr-10 rtl:ml-10">
|
||||
<img src="{{ asset('public/img/import.png') }}" alt="{{ trans('import.title', ['type' => $title_type]) }}">
|
||||
</div>
|
||||
|
||||
<div class="border-t-4 mt-8 border-blue-300 rounded-b-lg text-blue-700 px-4 py-3 shadow-md" role="alert">
|
||||
<div class="flex">
|
||||
<div>
|
||||
{!! trans('import.sample_file', ['download_link' => $sample_file]) !!}
|
||||
<!--
|
||||
<div class="hidden lg:flex w-4/12 mt-18 mr-14">
|
||||
<iframe width="560" height="244" src="https://www.youtube.com/embed/p98z142g2yY" frameborder="0" title="{{ trans('import.title', ['type' => $title_type]) }}" class="rounded-lg"></iframe>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="card-body mt-8 lg:w-8/12 w-full">
|
||||
<div class="w-full mt-8 bg-blue-100 rounded-lg text-blue-700 px-4 py-2" role="alert">
|
||||
<div class="flex">
|
||||
<span class="material-icons ltr:mr-3 rtl:ml-3">error_outline</span>
|
||||
|
||||
<div class="font-semibold text-sm mt-1">
|
||||
{!! trans('import.sample_file_and_document', [
|
||||
'download_link' => $sample_file,
|
||||
'document_link' => $document_link
|
||||
]) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<x-form.group.file name="import" dropzone-class="form-file" singleWidthClasses :options="['acceptedFiles' => '.xls,.xlsx']" form-group-class="mt-8" />
|
||||
<x-form.group.import
|
||||
name="import"
|
||||
dropzone-class="form-file"
|
||||
singleWidthClasses
|
||||
:options="['acceptedFiles' => '.xls,.xlsx']"
|
||||
form-group-class="mt-8"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8">
|
||||
@@ -58,4 +76,5 @@
|
||||
</x-slot>
|
||||
|
||||
<x-script folder="common" file="imports" />
|
||||
</x-layouts.admin>
|
||||
</x-layouts.admin>
|
||||
|
||||
|
||||
59
resources/views/components/form/group/import.blade.php
Normal file
59
resources/views/components/form/group/import.blade.php
Normal file
@@ -0,0 +1,59 @@
|
||||
@stack($name . '_input_start')
|
||||
<div
|
||||
@class([
|
||||
'relative',
|
||||
$formGroupClass,
|
||||
'required' => $required,
|
||||
'readonly' => $readonly,
|
||||
'disabled' => $disabled,
|
||||
])
|
||||
|
||||
@if (isset($attributes['v-show']))
|
||||
v-if="{{ $attributes['v-show'] }}"
|
||||
@endif
|
||||
|
||||
@if (isset($attributes['v-disabled']) || isset($attributes['v-bind:disabled']))
|
||||
:class="[
|
||||
{'disabled' : {{ (isset($attributes['v-disabled'])) ? $attributes['v-disabled'] : $attributes['v-bind:disabled'] }}},
|
||||
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
|
||||
]"
|
||||
@else
|
||||
:class="[
|
||||
{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}}
|
||||
]"
|
||||
@endif
|
||||
>
|
||||
@if (! $attributes->has('label') && ! empty($label->contents))
|
||||
{!! $label ?? '' !!}
|
||||
@elseif (! empty($label))
|
||||
<x-form.label for="{{ $name }}" :required="$required">{!! $label !!}</x-form.label>
|
||||
@endif
|
||||
|
||||
<div @class([
|
||||
$inputGroupClass,
|
||||
])
|
||||
>
|
||||
@if (! $attributes->has('icon') && ! empty($icon->contents))
|
||||
{!! $icon ?? '' !!}
|
||||
@elseif (! empty($icon))
|
||||
<x-form.icon icon="{{ $icon }}" />
|
||||
@endif
|
||||
|
||||
<x-form.input.import
|
||||
name="{{ $name }}"
|
||||
id="{{ $id }}"
|
||||
:value="$value"
|
||||
v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name : 'form.' . $name) }}"
|
||||
:multiple="$multiple"
|
||||
:options="$options"
|
||||
{{ $attributes->merge($custom_attributes) }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@if (! $attributes->has('error') && ! empty($error->contents))
|
||||
{!! $error ?? '' !!}
|
||||
@else
|
||||
<x-form.error name="{{ $name }}" {{ $attributes }} />
|
||||
@endif
|
||||
</div>
|
||||
@stack($name . '_input_end')
|
||||
75
resources/views/components/form/input/import.blade.php
Normal file
75
resources/views/components/form/input/import.blade.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<akaunting-import
|
||||
text-drop-file="{{ trans('import.drop_file') }}"
|
||||
text-extension-and-limitation-file="{!! trans('import.file_type_and_limitations', [
|
||||
'extensions' => strtoupper(config('excel.imports.extensions')),
|
||||
'row_limit' => config('excel.imports.row_limit')
|
||||
]) !!}"
|
||||
text-choose-file="{{ trans('general.form.choose_file') }}"
|
||||
|
||||
@if (! empty($attributes['dropzone-class']))
|
||||
class="{{ $attributes['dropzone-class'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($options))
|
||||
:options={{ json_encode($options) }}
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['previewClasses']))
|
||||
preview-classes="{{ $attributes['previewClasses'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($attributes['url']))
|
||||
url="{{ $attributes['url'] }}"
|
||||
@endif
|
||||
|
||||
@if (! empty($value))
|
||||
@php
|
||||
$attachments = [];
|
||||
@endphp
|
||||
|
||||
@if (is_array($value))
|
||||
@foreach($value as $attachment)
|
||||
@php
|
||||
$attachments[] = [
|
||||
'id' => $attachment->id,
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'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),
|
||||
'type' => $value->mime_type,
|
||||
'size' => $value->size,
|
||||
'downloadPath' => false,
|
||||
];
|
||||
@endphp
|
||||
@else
|
||||
@php
|
||||
$attachment = \Plank\Mediable\Media::find($value);
|
||||
|
||||
if (! empty($attachment)) {
|
||||
$attachments[] = [
|
||||
'id' => $attachment->id,
|
||||
'name' => $attachment->filename . '.' . $attachment->extension,
|
||||
'path' => route('uploads.get', $attachment->id),
|
||||
'type' => $attachment->mime_type,
|
||||
'size' => $attachment->size,
|
||||
'downloadPath' => false,
|
||||
];
|
||||
}
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
:attachments="{{ json_encode($attachments) }}"
|
||||
@endif
|
||||
|
||||
v-model="{{ ! empty($attributes['v-model']) ? $attributes['v-model'] : (! empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name) }}"
|
||||
></akaunting-import>
|
||||
Reference in New Issue
Block a user