ldc-doux/resources/views/back/texts/form-inputs.blade.php
2024-04-08 10:42:52 +02:00

64 lines
2.7 KiB
PHP

<div class="forms-group">
<div class="form-group">
<label for="title">{{ __('Titre') }} *</label>
<input class="form-control" id="title" name="title" type="text" value="{{ old('title', $text->title ?? '') }}"
placeholder="{{ __('Titre') }} *" required>
@include('back.modules.input-error', ['inputName' => 'title'])
</div>
<div class="form-group">
<label for="text">{{ __('Texte') }} *</label>
<textarea class="form-control" id="text" name="text" style="height: 150px;" placeholder="{{ __('Texte') }}">{{ old('commentaire', $text->text ?? '') }}</textarea>
@include('back.modules.input-error', ['inputName' => 'text'])
</div>
</div>
@push('scripts')
<script type="text/javascript" nonce="{{ $nonce }}">
var editorConfig = {
removePlugins: ["Image", "ImageCaption", "ImageStyle", "ImageToolbar", "ImageUpload"],
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', '|', 'blockQuote', 'insertTable', '|',
'undo', 'redo'
],
heading: {
options: [{
model: 'paragraph',
title: 'Paragraph',
class: 'ck-heading_paragraph'
},
{
model: 'heading1',
view: 'h1',
title: 'Heading 1',
class: 'ck-heading_heading1'
},
{
model: 'heading2',
view: 'h2',
title: 'Heading 2',
class: 'ck-heading_heading2'
},
{
model: 'heading3',
view: 'h3',
title: 'Heading 3',
class: 'ck-heading_heading3'
},
{
model: 'heading4',
view: 'h4',
title: 'Heading 4',
class: 'ck-heading_heading4'
}
]
},
table: {
contentToolbar: ['tableColumn', 'tableRow', 'mergeTableCells']
}
};
ClassicEditor
.create(document.querySelector('#text'), editorConfig)
.catch(error => {
console.error(error);
});
</script>
@endpush