ldc-gen-game-web/resources/views/bo/content/manage.blade.php
2020-11-09 11:22:12 +01:00

65 lines
2.6 KiB
PHP

@extends('layouts.bo')
@section('content')
<div class="card">
<div class="card-header">
{{ ucfirst($content->key) }}
</div>
<form action="{{route('bo.content', $content->id)}}" method="POST">
@method('PUT')
@csrf
<div class="card-body">
<div class="row">
<div class="col-md-10 offset-md-1 align-left">
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@if (session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<div class="form-group">
<textarea class="form-control" id="value" name="value" placeholder="Contenu *">{{$content->value}}</textarea>
</div>
</div>
</div>
</div>
<div class="card-footer text-center">
<input type="submit" class="btn btn-success" value="Enregistrer">
</div>
</form>
</div>
@endsection
@section('scripts')
<script type="text/javascript">
ClassicEditor
.create( document.querySelector( '#value' ), {
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' ]
}
} )
.catch( error => {
console.error( error );
} );
</script>
@endsection