@extends('Admin.layouts.master')

@section('content')
@php 
  $currentPage = 'manage_cms';
@endphp
<style>
    .error-message {
        color: #FF0000;
    }

    form .error-message {
        color: red;
        /* Set your desired color here */
    }

    form .input_class.error-message {
        color: #0e1726;
    }
</style>



        <div class="layout-px-spacing">
            <div class="middle-content container-xxl p-0">
                <div class="row layout-top-spacing ">
                    <div class="top-tabel">
                        <div class="row">
                            <div class="col-md-12 left d-flex align-items-center justify-content-between"
                                style="gap: 15px;">
                                <a class="d-flex align-items-center justify-content-center pl-2"
                                    href="{{ route('manage.privacy')}}">
                                    <img class="back-btn" src="{{ asset('public/assets/img/left-arrow.svg')}}">
                                    <h6 class="card-title p-0">Edit Details for resturant</h6>
                                </a>

                            </div>
                        </div>
                    </div>
                    <div class="col-xl-12 col-lg-12 col-sm-12  layout-spacing">
                        <div class="widget-content widget-content-area br-8 position-btn p-0">
                            <div class="view-details">
                                <div class="simple-tab">
                                    <div class="tab-content" id="myTabContent">
                                        <div class="tab-pane fade show active" id="home-tab-pane" role="tabpanel"
                                            aria-labelledby="home-tab" tabindex="0">
                                            <form id="privacy_policy_form_rest">
                                            <div class="row">
                                                <div class="col-md-12">
                                                    <input type="hidden" name="privacy_rest_id" value="{{ $edit_privacy_policy_rest['id'] }}">
                                                    <div  id="terms-quill-edit" name="edit_privacy_policy_rest" class="editor-quill" style="height: 300px;" minlength="10">{!! $edit_privacy_policy_rest['description'] !!}</div>
                                                    <input type="hidden" id="edit_privacy_policy_rest" name="edit_privacy_policy_rest" value="{{ $edit_privacy_policy_rest['description'] }}" />  
                                                </div>
                                                <div class="col-md-12">
                                                    <button id="update_privacy_policy_rest" class="download-btn-custom mt-3 custom-width-10" >
                                                        <span>Update</span>
                                                    </button>
                                                </div>
                                            </div>
                                        </form>   
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
 
<!-- END MAIN CONTAINER -->



@endsection
@section('section_script')
<script>
    var quill = new Quill('#terms-quill-edit', {
        theme: 'snow'
    });
    
    // Listen for changes and update the hidden input with the HTML content
    quill.on('text-change', function() {
            var htmlContent = quill.root.innerHTML;
            document.getElementById('edit_privacy_policy_rest').value = htmlContent;
        });
</script>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
<script src="{{ asset('public/assets/js/admin/manage_cms/manage_privacy_policy/privacy_policy.js')}}"></script>
@endsection