@extends('twill::layouts.main') @section('appTypeClass', 'body--listing') @php $translate = $translate ?? false; $translateTitle = $translateTitle ?? $translate ?? false; $reorder = $reorder ?? false; $nested = $nested ?? false; $bulkEdit = $bulkEdit ?? true; $create = $create ?? false; $skipCreateModal = $skipCreateModal ?? false; $controlLanguagesPublication = $controlLanguagesPublication ?? true; $requestFilter = json_decode(request()->get('filter'), true) ?? []; @endphp @push('extra_css') @if(app()->isProduction()) @endif @unless(config('twill.dev_mode', false)) @endunless @endpush @push('extra_js_head') @if(app()->isProduction()) @endif @endpush @section('content')
@forelse($hiddenFilters as $filter) @if ($loop->first)
@endif @if (isset(${$filter.'List'})) @php $list = ${$filter.'List'}; $options = is_object($list) && method_exists($list, 'map') ? $list->map(function($label, $value) { return [ 'value' => $value, 'label' => $label, ]; })->values()->toArray() : $list; $selectedIndex = isset($requestFilter[$filter]) ? array_search($requestFilter[$filter], array_column($options, 'value')) : false; @endphp @endif @if ($loop->last)
@endif @empty @hasSection('hiddenFilters')
@yield('hiddenFilters')
@endif @endforelse @if($create)
{{ twillTrans('twill::lang.listing.add-new-button') }} @foreach($filterLinks as $link) {{ $link['label'] }} @endforeach
@elseif(isset($filterLinks) && count($filterLinks))
@foreach($filterLinks as $link) {{ $link['label'] }} @endforeach
@endif @if(isset($additionalTableActions) && count($additionalTableActions))
@foreach($additionalTableActions as $additionalTableAction) {{ $additionalTableAction['name'] }} @endforeach
@endif
@if($bulkEdit) @endif
@if($nested) @else @endif @if($create) @partialView(($moduleName ?? null), 'create', ['renderForModal' => true]) @endif

{{ twillTrans('twill::lang.listing.dialogs.delete.disclaimer') }}

{{ twillTrans('twill::lang.listing.dialogs.destroy.disclaimer') }}

@stop @section('initialStore') window['{{ config('twill.js_namespace') }}'].CMS_URLS = { index: @if(isset($indexUrl)) '{{ $indexUrl }}' @else window.location.href.split('?')[0] @endif, publish: '{{ $publishUrl }}', bulkPublish: '{{ $bulkPublishUrl }}', restore: '{{ $restoreUrl }}', bulkRestore: '{{ $bulkRestoreUrl }}', forceDelete: '{{ $forceDeleteUrl }}', bulkForceDelete: '{{ $bulkForceDeleteUrl }}', reorder: '{{ $reorderUrl }}', create: '{{ $createUrl ?? '' }}', feature: '{{ $featureUrl }}', bulkFeature: '{{ $bulkFeatureUrl }}', bulkDelete: '{{ $bulkDeleteUrl }}' } window['{{ config('twill.js_namespace') }}'].STORE.form = { fields: [] } window['{{ config('twill.js_namespace') }}'].STORE.datatable = { data: {!! json_encode($tableData) !!}, columns: {!! json_encode($tableColumns) !!}, navigation: {!! json_encode($tableMainFilters) !!}, filter: { status: '{{ $filters['status'] ?? $defaultFilterSlug ?? 'all' }}' }, page: '{{ request('page') ?? 1 }}', maxPage: '{{ $maxPage ?? 1 }}', defaultMaxPage: '{{ $defaultMaxPage ?? 1 }}', offset: '{{ request('offset') ?? $offset ?? 60 }}', defaultOffset: '{{ $defaultOffset ?? 60 }}', sortKey: '{{ $reorder ? (request('sortKey') ?? '') : (request('sortKey') ?? '') }}', sortDir: '{{ request('sortDir') ?? 'asc' }}', baseUrl: '{{ rtrim(config('app.url'), '/') . '/' }}', localStorageKey: '{{ isset($currentUser) ? $currentUser->id : 0 }}__{{ $moduleName ?? Route::currentRouteName() }}' } @if ($create && ($openCreate ?? false)) window['{{ config('twill.js_namespace') }}'].openCreate = {!! json_encode($openCreate) !!} @endif @stop @push('extra_js') @endpush