@extends('layouts.idara.panel')


@section('content')
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
@include('backend.partials.features')

<div class="container">
    <div class="card">
        <h5 class="card-header">Modifier la présentation</h5>
        <div class="card-body">
            <form action="{{url('presentation/'.$article->id)}}" method="post">
                <input type="hidden" name="_method" value="PUT">
                @csrf
                <div class="form-group">
                    <label for="exampleFormControlInput1">Titre</label>
                    <input type="text" class="form-control" name="titre" placeholder="" value="{{$article->titre}}" required>
                </div>

                <div class="form-group mt-4">
                    <label for="exampleFormControlTextarea1">Presentation</label>
                    <textarea class="form-control" id="presentation" name="texte" rows="3">{!! html_entity_decode   ($article->texte)!!}</textarea>
                </div>

                <div class="form-group mt-4">
                    <label for="exampleFormControlTextarea1">Resume</label>
                    <textarea class="form-control" id="details" name="details" rows="3">{!! html_entity_decode   ($article->details)!!}</textarea>
                </div>
                
                <div class="form-group add mt-4">
                    <button type="submit" class="btn btn-danger" value="">Modifier</button>

                </div>
            </form>
        </div>
    </div>
</div>

<style>
    .presentation {
        padding-top: 127px;
        margin: -1px 0 0 41px;
    }

    .clean {
        padding: 16px 9px 19px 15px;
        margin-top: -30px;
        font-size: 19px;
        font-weight: 600;
        color: #764b4b;

    }

    

    .ck.ck-editor__main>.ck-editor__editable:not(.ck-focused) {
        border-color: var(--ck-color-base-border);
        height: 232px !important;
    }

</style>

<script src="https://cdn.ckeditor.com/ckeditor5/36.0.0/classic/ckeditor.js"></script>
<script>
    ClassicEditor
        .create(document.querySelector('#presentation'))
        .then(editor => {
            window.editor = editor;
        })
        .catch(error => {
            console.error('There was a problem initializing the editor.', error);
        });

        ClassicEditor
        .create(document.querySelector('#details'))
        .then(editor => {
            window.editor = editor;
        })
        .catch(error => {
            console.error('There was a problem initializing the editor.', error);
        });

</script>
@endsection
