|
| 1 | +@php use A17\Twill\Facades\TwillBlocks; @endphp |
1 | 2 | @extends('twill::layouts.main') |
2 | 3 |
|
3 | 4 | @section('appTypeClass', 'body--form') |
4 | 5 |
|
5 | 6 | @push('extra_css') |
6 | 7 | @if(app()->isProduction()) |
7 | | - <link href="{{ twillAsset('main-form.css') }}" rel="preload" as="style" crossorigin/> |
| 8 | + <link href="{{ twillAsset('main-form.css') }}" rel="preload" as="style" crossorigin /> |
8 | 9 | @endif |
9 | 10 |
|
10 | 11 | @unless(config('twill.dev_mode', false)) |
11 | | - <link href="{{ twillAsset('main-form.css') }}" rel="stylesheet" crossorigin/> |
| 12 | + <link href="{{ twillAsset('main-form.css') }}" rel="stylesheet" crossorigin /> |
12 | 13 | @endunless |
13 | 14 | @endpush |
14 | 15 |
|
15 | 16 | @push('extra_js_head') |
16 | 17 | @if(app()->isProduction()) |
17 | | - <link href="{{ twillAsset('main-form.js') }}" rel="preload" as="script" crossorigin/> |
| 18 | + <link href="{{ twillAsset('main-form.js') }}" rel="preload" as="script" crossorigin /> |
18 | 19 | @endif |
19 | 20 | @endpush |
20 | 21 |
|
|
136 | 137 | :items-in-selects-tables="$users" |
137 | 138 | label-key="name" |
138 | 139 | name-pattern="user_%id%_permission" |
139 | | - :list-user="true"/> |
| 140 | + :list-user="true" /> |
140 | 141 | </x-twill::formFieldset> |
141 | 142 | @endcan |
142 | 143 | @endif |
|
155 | 156 | </a17-modal> |
156 | 157 | <a17-editor v-if="editor" ref="editor" |
157 | 158 | bg-color="{{ config('twill.block_editor.background_color') ?? '#FFFFFF' }}"></a17-editor> |
158 | | - <a17-previewer ref="preview" :breakpoints-config="{{ json_encode(config('twill.preview.breakpoints')) }}"></a17-previewer> |
| 159 | + <a17-previewer ref="preview" |
| 160 | + :breakpoints-config="{{ json_encode(config('twill.preview.breakpoints')) }}"></a17-previewer> |
159 | 161 | <a17-dialog ref="warningContentEditor" modal-title="{{ twillTrans('twill::lang.form.dialogs.delete.title') }}" |
160 | 162 | confirm-label="{{ twillTrans('twill::lang.form.dialogs.delete.confirm') }}"> |
161 | 163 | <p class="modal--tiny-title"> |
|
173 | 175 | restoreUrl: '{{ $restoreUrl ?? '' }}', |
174 | 176 | availableBlocks: {}, |
175 | 177 | blocks: {}, |
176 | | - allAvailableBlocks: {!! json_encode($allBlocks ?? []) !!}, |
| 178 | + allAvailableBlocks: {!! TwillBlocks::getListOfUsedBlocks() !!} |
177 | 179 | blockPreviewUrl: '{{ $blockPreviewUrl ?? '' }}', |
178 | 180 | repeaters: {!! json_encode(($form_fields['repeaters'] ?? []) + ($form_fields['blocksRepeaters'] ?? [])) !!}, |
179 | 181 | fields: [], |
|
235 | 237 | const checked = mutation.payload.value |
236 | 238 | if (!isNaN(groupId)) { |
237 | 239 | const users = groupUserMapping[groupId] |
238 | | - users.forEach(function (userId) { |
| 240 | + users.forEach(function(userId) { |
239 | 241 | // If the user's permission is <= view, it will be updated |
240 | | - const currentPermission = state['form']['fields'].find(function (e) { |
241 | | - return e.name == `user_${userId}_permission` |
| 242 | + const currentPermission = state['form']['fields'].find(function(e) { |
| 243 | + return e.name === `user_${userId}_permission` |
242 | 244 | }).value |
243 | 245 | if (currentPermission === '' || currentPermission === 'view-item') { |
244 | 246 | const field = { |
|
0 commit comments