<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('ad_page_title', 'Edit Page Content'); ?>
<?php $__env->startSection('ad_page_subtitle', 'Edit JSON content (EN/AR) + SEO'); ?>

<?php $__env->startSection('ad_content'); ?>
<div class="container-fluid py-4">
    <div class="mb-4 d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3">
        <div>
            <h1 class="h3 mb-1">Edit: <span class="text-primary">`<?php echo e($pageKey); ?>`</span></h1>
            <p class="text-muted mb-0">Update the dynamic blocks used by this page.</p>
        </div>
        <a href="<?php echo e(route('admin.pages.page-contents.index')); ?>" class="btn btn-light border">Back</a>
    </div>

    <?php if(session('success')): ?>
        <div class="alert alert-success" role="alert">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <?php if($errors->any()): ?>
        <div class="alert alert-danger" role="alert">
            <div class="fw-bold mb-2">Fix the following issues:</div>
            <ul class="mb-0">
                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li><?php echo e($error); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
    <?php endif; ?>

    <form action="<?php echo e(route('admin.pages.page-contents.update', ['pageKey' => $pageKey])); ?>" method="POST">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <div class="card shadow-sm border-0">
            <div class="card-body p-4">
                <div class="row g-4">
                    <div class="col-lg-6">
                        <label class="form-label fw-bold">data_en (JSON)</label>
                        <textarea
                            name="data_en"
                            rows="20"
                            class="form-control ad_textarea <?php $__errorArgs = ['data_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                        ><?php echo e(old('data_en', $dataEnJson)); ?></textarea>
                        <?php $__errorArgs = ['data_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="col-lg-6">
                        <label class="form-label fw-bold">data_ar (JSON)</label>
                        <textarea
                            name="data_ar"
                            rows="20"
                            class="form-control ad_textarea <?php $__errorArgs = ['data_ar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                            dir="rtl"
                        ><?php echo e(old('data_ar', $dataArJson)); ?></textarea>
                        <?php $__errorArgs = ['data_ar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="invalid-feedback d-block"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                </div>

                <hr class="my-4">

                <div class="row g-3">
                    <div class="col-lg-6">
                        <label class="form-label">SEO Title (EN)</label>
                        <input type="text" name="seo[title_en]" value="<?php echo e(old('seo.title_en', $seo->title_en)); ?>" class="form-control <?php $__errorArgs = ['seo.title_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>
                    <div class="col-lg-6">
                        <label class="form-label">SEO Title (AR)</label>
                        <input type="text" name="seo[title_ar]" value="<?php echo e(old('seo.title_ar', $seo->title_ar)); ?>" dir="rtl" class="form-control <?php $__errorArgs = ['seo.title_ar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>

                    <div class="col-lg-6">
                        <label class="form-label">SEO Description (EN)</label>
                        <textarea name="seo[description_en]" rows="3" class="form-control <?php $__errorArgs = ['seo.description_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"><?php echo e(old('seo.description_en', $seo->description_en)); ?></textarea>
                    </div>
                    <div class="col-lg-6">
                        <label class="form-label">SEO Description (AR)</label>
                        <textarea name="seo[description_ar]" rows="3" dir="rtl" class="form-control <?php $__errorArgs = ['seo.description_ar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"><?php echo e(old('seo.description_ar', $seo->description_ar)); ?></textarea>
                    </div>

                    <div class="col-lg-6">
                        <label class="form-label">SEO Keywords (EN)</label>
                        <textarea name="seo[keywords_en]" rows="3" class="form-control <?php $__errorArgs = ['seo.keywords_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"><?php echo e(old('seo.keywords_en', $seo->keywords_en)); ?></textarea>
                    </div>
                    <div class="col-lg-6">
                        <label class="form-label">SEO Keywords (AR)</label>
                        <textarea name="seo[keywords_ar]" rows="3" dir="rtl" class="form-control <?php $__errorArgs = ['seo.keywords_ar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"><?php echo e(old('seo.keywords_ar', $seo->keywords_ar)); ?></textarea>
                    </div>

                    <div class="col-lg-6">
                        <label class="form-label">H1 Heading (EN)</label>
                        <input type="text" name="seo[heading_en]" value="<?php echo e(old('seo.heading_en', $seo->heading_en)); ?>" class="form-control <?php $__errorArgs = ['seo.heading_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>
                    <div class="col-lg-6">
                        <label class="form-label">H1 Heading (AR)</label>
                        <input type="text" name="seo[heading_ar]" value="<?php echo e(old('seo.heading_ar', $seo->heading_ar)); ?>" dir="rtl" class="form-control <?php $__errorArgs = ['seo.heading_ar'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>

                    <div class="col-lg-6">
                        <label class="form-label">Canonical URL</label>
                        <input type="text" name="seo[canonical_url]" value="<?php echo e(old('seo.canonical_url', $seo->canonical_url)); ?>" class="form-control <?php $__errorArgs = ['seo.canonical_url'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>
                    <div class="col-lg-6">
                        <label class="form-label">Robots</label>
                        <input type="text" name="seo[robots]" value="<?php echo e(old('seo.robots', $seo->robots)); ?>" class="form-control <?php $__errorArgs = ['seo.robots'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>

                    <div class="col-lg-6">
                        <label class="form-label">OG Type</label>
                        <input type="text" name="seo[og_type]" value="<?php echo e(old('seo.og_type', $seo->og_type)); ?>" class="form-control <?php $__errorArgs = ['seo.og_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>
                    <div class="col-lg-6">
                        <label class="form-label">Twitter Card</label>
                        <input type="text" name="seo[twitter_card]" value="<?php echo e(old('seo.twitter_card', $seo->twitter_card)); ?>" class="form-control <?php $__errorArgs = ['seo.twitter_card'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                    </div>

                    <div class="col-lg-12">
                        <label class="form-label">Schema JSON</label>
                        <textarea name="seo[schema_json]" rows="3" class="form-control <?php $__errorArgs = ['seo.schema_json'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"><?php echo e(old('seo.schema_json', $seo->schema_json)); ?></textarea>
                    </div>
                </div>

                <div class="d-flex justify-content-end gap-2 mt-4">
                    <a href="<?php echo e(route('admin.pages.page-contents.index')); ?>" class="btn btn-light border">Cancel</a>
                    <button type="submit" class="btn btn-primary px-4">Save Changes</button>
                </div>
            </div>
        </div>
    </form>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('admin.ad_master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/onesourceerp/public_html/project/resources/views/admin/pages/page-contents/edit.blade.php ENDPATH**/ ?>