@include('layouts.header')
<link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/43.3.0/ckeditor5.css">

<!-- BEGIN: Content-->
<div class="app-content content ">
  <div class="content-overlay"></div>
  <div class="header-navbar-shadow"></div>
  <div class="content-wrapper">
    <div class="content-body">

<div class="text-center mb-2">
    <h2 class="mb-1">{{ __('Edit') }} {{ $documentation->title }} ({{$documentation->id}})</h2>
</div>
<form action="{{ route('documentation.update', $documentation->id) }}" method="POST" class="row gy-1 pt-75">
    @csrf @method('patch')
    <div class="row">
        <div class="col-12 col-md-6 mb-2">
            <input type="hidden" name="documentation_id" value="{{ $documentation->id }}" />
            <label class="form-label" for="role">{{ __('Role') }}</label>
            <select class="form-control" name="role">
                <option value="user" {{ $documentation->role === 'user' ? 'selected' : '' }}>user</option>
                <option value="admin" {{ $documentation->role === 'admin' ? 'selected' : '' }}>admin</option>
            </select>
        </div>
        {{--<div class="col-12 col-md-6 mb-2">
            <label class="form-label" for="lang">{{ __('Language') }}</label>
            <input type="text" name="lang" class="form-control" value="{{ $documentation->lang }}" required />
        </div>--}}
        <div class="col-12 col-md-6 mb-2">
            <label class="form-label" for="highlight">{{ __('Highlight') }}</label> <label class="form-label text-warning"> ({{ __('Optional') }}) </label>
            <input type="text" name="highlight" class="form-control" value="{{ $documentation->highlight }}" />
        </div>
        <div class="col-12 col-md-6 mb-2">
            <label class="form-label" for="topic">{{ __('Topic') }}</label>
            <input type="text" name="topic" class="form-control" value="{{ $documentation->topic }}" required />
        </div>
        <div class="col-12 col-md-6 mb-2">
            <label class="form-label" for="title">{{ __('Title') }}</label>
            <input type="text" name="title" class="form-control" value="{{ $documentation->title }}" required />
        </div>
        <div class="col-12 mb-2">
            <label class="form-label" for="edit-content">{{ __('Content') }}</label>
            <textarea class="form-control" id="content" name="content">{{ $documentation->content }}</textarea><br>
        </div>
        <div class="col-12 text-center mt-4 pt-50">
            <button type="submit" class="btn btn-primary me-1">{{ __('Save') }}</button>
            <a href="javascript:window.history.back();" class="btn btn-outline-secondary">{{ __('Cancel') }}</a>
        </div>
    </div>
</form>

        </div>
    </div>
</div>
<!-- BEGIN: Vendor JS-->
<script src="{{ url('/') }}/app-assets/vendors/js/vendors.min.js"></script>
<!-- BEGIN Vendor JS-->

<script src="https://cdn.ckeditor.com/ckeditor5/43.3.0/ckeditor5.js"></script>
<!-- <script src="{{ url('/') }}/app-assets/vendors/js/editors/ckeditor5/ckeditor.js"></script> -->
<script>
    ClassicEditor
        .create( document.querySelector( '#content' ) )
        .catch( error => {
            console.error( error );
        } );
</script>

@include('layouts.footer')
