@extends('twill::layouts.main') @section('appTypeClass', 'body--form') @push('extra_css') @if(app()->isProduction()) @endif @unless(config('twill.dev_mode', false)) @endunless @endpush @push('extra_js_head') @if(app()->isProduction()) @endif @endpush @php $editor = $editor ?? false; $translate = $translate ?? false; $translateTitle = $translateTitle ?? $translate ?? false; $titleFormKey = $titleFormKey ?? 'title'; $customForm = $customForm ?? false; $controlLanguagesPublication = $controlLanguagesPublication ?? true; $disableContentFieldset = $disableContentFieldset ?? false; $editModalTitle = ($createWithoutModal ?? false) ? twillTrans('twill::lang.modal.create.title') : null; $item = isset($item) ? $item : null; // TODO: cache and move out of view if (config('twill.enabled.permissions-management')) { $users = app()->make('A17\Twill\Repositories\UserRepository')->published()->notSuperAdmin()->get(); $groups = app()->make('A17\Twill\Repositories\GroupRepository')->get()->map(function ($group) { return [ 'name' => $group->id . '_group_authorized', 'value' => $group->id, 'label' => $group->name ]; }); } @endphp @section('content')
@if ($formBuilder->hasForm()) {!! $formBuilder->renderBaseForm() !!} @else @unless($disableContentFieldset) @yield('contentFields') @endunless @yield('fieldsets') @endif @if(\A17\Twill\Facades\TwillPermissions::levelIs(\A17\Twill\Enums\PermissionLevel::LEVEL_ROLE_GROUP_ITEM)) @if($showPermissionFieldset ?? null) @can('manage-item', isset($item) ? $item : null) @endcan @endif @endif

{!! twillTrans('twill::lang.form.dialogs.delete.confirmation') !!}

@stop @section('initialStore') window['{{ config('twill.js_namespace') }}'].STORE.form = { baseUrl: '{{ $baseUrl ?? '' }}', saveUrl: '{{ $saveUrl }}', previewUrl: '{{ $previewUrl ?? '' }}', restoreUrl: '{{ $restoreUrl ?? '' }}', availableBlocks: {}, blocks: {}, blockPreviewUrl: '{{ $blockPreviewUrl ?? '' }}', repeaters: {!! json_encode(($form_fields['repeaters'] ?? []) + ($form_fields['blocksRepeaters'] ?? [])) !!}, fields: [], editor: {{ $editor ? 'true' : 'false' }}, isCustom: {{ $customForm ? 'true' : 'false' }}, reloadOnSuccess: {{ ($reloadOnSuccess ?? false) ? 'true' : 'false' }}, editorNames: [] } window['{{ config('twill.js_namespace') }}'].STORE.publication = { withPublicationToggle: {{ json_encode(($publish ?? true) && $item?->isFillable('published')) }}, published: {{ $item?->published ? 'true' : 'false' }}, createWithoutModal: {{ isset($createWithoutModal) && $createWithoutModal ? 'true' : 'false' }}, withPublicationTimeframe: {{ json_encode(($schedule ?? true) && $item?->isFillable('publish_start_date')) }}, publishedLabel: '{{ $publishedLabel ?? twillTrans('twill::lang.main.published') }}', draftLabel: '{{ $draftLabel ?? twillTrans('twill::lang.main.draft') }}', expiredLabel: '{{twillTrans('twill::lang.publisher.expired')}}', scheduledLabel: '{{twillTrans('twill::lang.publisher.scheduled')}}', submitDisableMessage: '{{ $submitDisableMessage ?? '' }}', startDate: '{{ $item?->publish_start_date ?? '' }}', endDate: '{{ $item?->publish_end_date ?? '' }}', visibility: '{{ $item?->isFillable('public') ? ($item?->public ? 'public' : 'private') : false }}', reviewProcess: {!! isset($reviewProcess) ? json_encode($reviewProcess) : '[]' !!}, submitOptions: {!! isset($submitOptions) ? json_encode($submitOptions) : 'null' !!} } window['{{ config('twill.js_namespace') }}'].STORE.revisions = {!! json_encode($revisions ?? []) !!} window['{{ config('twill.js_namespace') }}'].STORE.parentId = {{ $item?->parent_id ?? 0 }} window['{{ config('twill.js_namespace') }}'].STORE.parents = {!! json_encode($parents ?? []) !!} @if (isset($item) && classHasTrait($item, \A17\Twill\Models\Behaviors\HasMedias::class)) window['{{ config('twill.js_namespace') }}'].STORE.medias.crops = {!! json_encode(($item->getMediasParams()) + \A17\Twill\Facades\TwillBlocks::getAllCropConfigs() + (config('twill.settings.crops') ?? [])) !!} @else window['{{ config('twill.js_namespace') }}'].STORE.medias.crops = {!! json_encode(\A17\Twill\Facades\TwillBlocks::getAllCropConfigs() + (config('twill.settings.crops') ?? [])) !!} @endif window['{{ config('twill.js_namespace') }}'].STORE.medias.selected = {} window['{{ config('twill.js_namespace') }}'].STORE.browser = {} window['{{ config('twill.js_namespace') }}'].STORE.browser.selected = {} window['{{ config('twill.js_namespace') }}'].APIKEYS = { 'googleMapApi': '{{ config('twill.google_maps_api_key') }}' } {{-- Permissions --}} window['{{ config('twill.js_namespace') }}'].STORE.groups = {!! isset($groups) ? json_encode($groups) : '[]' !!}; window['{{ config('twill.js_namespace') }}'].STORE.groupUserMapping = {!! isset($groupUserMapping) ? json_encode($groupUserMapping) : '[]' !!}; @stop @prepend('extra_js') @includeWhen(config('twill.block_editor.inline_blocks_templates', true), 'twill::partials.form.utils._blocks_templates') @endprepend