
<?php $__env->startSection('title'); ?>
    <?php echo e(__('Edit Page')); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('style'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('backend/css/choices.min.css')); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="main-content">
        <div class="page-title">
            <div class="container-fluid">
                <div class="row justify-content-center">
                    <div class="col-xl-12">
                        <div class="title-content">
                            <h2 class="title"><?php echo e(__('Update Page')); ?></h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="site-tab-bars">
            <ul class="nav nav-pills" id="pills-tab" role="tablist">
                <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="nav-item" role="presentation">
                        <a
                            href=""
                            class="nav-link  <?php echo e($loop->index == 0 ?'active' : ''); ?>"
                            id="pills-informations-tab"
                            data-bs-toggle="pill"
                            data-bs-target="#<?php echo e($language->locale); ?>"
                            type="button"
                            role="tab"
                            aria-controls="pills-informations"
                            aria-selected="true"
                        ><i data-lucide="languages"></i><?php echo e($language->name); ?></a
                        >
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


            </ul>
        </div>

        <div class="tab-content" id="pills-tabContent">

            <?php $__currentLoopData = $groupData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <?php
                    $data = new Illuminate\Support\Fluent($value);
                ?>

                <div
                    class="tab-pane fade <?php echo e($loop->index == 0 ?'show active' : ''); ?>"
                    id="<?php echo e($key); ?>"
                    role="tabpanel"
                    aria-labelledby="pills-informations-tab"
                >

                <div class="site-card">
                    <div class="site-card-header">
                        <h3 class="title"><?php echo e(__('Activity and Contents')); ?></h3>
                            <?php if($key == 'en'): ?>
                                <form action="<?php echo e(route('admin.page.delete.now')); ?>" method="post">
                                    <?php echo csrf_field(); ?>
                                    <input type="hidden" name="page_code" value="<?php echo e($code); ?>">
                                    <a href="<?php echo e(route('dynamic.page',$code)); ?>" target="_blank" class="site-btn-sm primary-btn"> <i data-lucide="eye"></i> <?php echo e(__('View Page')); ?></a>
                                    <button type="submit" class="site-btn-sm red-btn"><i data-lucide="trash"></i> <?php echo e(__('Delete')); ?></button>
                                </form>
                            <?php endif; ?>
                        </div>
                        <div class="site-card-body">
                            <form action="<?php echo e(route('admin.page.update')); ?>" method="post">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="page_code" value="<?php echo e($code); ?>">
                                <input type="hidden" name="page_locale" value="<?php echo e($key); ?>">


                                <div class="site-input-groups row">
                                    <label for="" class="col-sm-3 col-label"><?php echo e(__('Page Title')); ?><i data-lucide="info"
                                                                                                    data-bs-toggle="tooltip"
                                                                                                    title=""
                                                                                                    data-bs-original-title="Page Title will show on Breadcrumb"></i></label>
                                    <div class="col-sm-9">
                                        <input type="text" name="title" class="box-input" placeholder="New Page Name" value="<?php echo e($data->title ?? $title); ?>">
                                    </div>

                                </div>

                                <?php if($key != 'en'): ?>
                                    <input type="hidden" name="section_id" value="<?php echo e($data->section_id); ?>">
                                <?php endif; ?>

                                <?php if($key == 'en'): ?>
                                <div class="site-input-groups row mb-0">
                                        <label for="" class="col-sm-3 col-label"><?php echo e(__('Content Come From')); ?><i
                                                data-lucide="info" data-bs-toggle="tooltip" title=""
                                                data-bs-original-title="The Contents will come from a section. Don't need any? Leave it blank"></i></label>
                                        <div class="col-sm-9">
                                            <div class="site-input-groups">
                                                <div class="site-input-groups">
                                                    <select name="section_id[]" id="section_id" class="form-select" multiple>
                                                        <?php $__currentLoopData = $landingSections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <option <?php if(is_array(json_decode($data->section_id)) && in_array($section->id,json_decode($data->section_id))): echo 'selected'; endif; ?> value="<?php echo e($section->id); ?>"><?php echo e($section->name); ?></option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php endif; ?>

                                <div class="site-input-groups row">
                                    <label for="" class="col-sm-3 col-label"><?php echo e(__('Page Contents')); ?><i
                                            data-lucide="info" data-bs-toggle="tooltip" title=""
                                            data-bs-original-title="Leave it blank if you don't need any custom content"></i></label>
                                    <div class="col-sm-9">
                                        <div class="site-editor fw-normal">
                                    <textarea class="summernote"
                                            name="content"><?php echo $data->content; ?></textarea>
                                        </div>
                                    </div>
                                </div>


                                <div class="site-input-groups row mb-4">
                                    <label for="" class="col-sm-3 col-label"></label>
                                    <div class="col-sm-9">
                                        <hr>
                                    </div>
                                </div>


                                <div class="site-input-groups row">
                                    <label for="" class="col-sm-3 col-label"><?php echo e(__('Seo Keywords')); ?><i data-lucide="info"
                                                                                                        data-bs-toggle="tooltip"
                                                                                                        title=""
                                                                                                        data-bs-original-title="Page Seo Keywords"></i></label>
                                    <div class="col-sm-9">
                                        <input type="text" name="meta_keywords" class="box-input"
                                            value="<?php echo e($data->meta_keywords); ?>">
                                    </div>
                                </div>

                                <div class="site-input-groups row">
                                    <label for="" class="col-sm-3 col-label"><?php echo e(__('Seo Description')); ?><i
                                            data-lucide="info" data-bs-toggle="tooltip" title=""
                                            data-bs-original-title="Page Seo Description"></i></label>
                                    <div class="col-sm-9">
                                        <textarea name="meta_description" id="" cols="30" rows="5" class="form-textarea"><?php echo e($data->meta_description); ?></textarea>
                                    </div>
                                </div>

                                <div class="site-input-groups row <?php if($key != 'en'): ?> hidden <?php endif; ?>">
                                    <label for="" class="col-sm-3 col-label pt-0"><?php echo e(__('Page Status')); ?><i
                                            data-lucide="info" data-bs-toggle="tooltip" title=""
                                            data-bs-original-title="Manage Page Visibility"></i></label>
                                    <div class="col-sm-3">
                                        <div class="site-input-groups">
                                            <div class="switch-field">
                                                <input type="radio" id="active" name="status" <?php if($status): ?> checked
                                                        <?php endif; ?> value="1"/>
                                                <label for="active"><?php echo e(__('Show')); ?></label>
                                                <input type="radio" id="deactivate" name="status" <?php if(!$status): ?> checked
                                                        <?php endif; ?> value="0"/>
                                                <label for="deactivate"><?php echo e(__('Hide')); ?></label>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="offset-sm-3 col-sm-9">
                                        <button type="submit" class="site-btn-sm primary-btn w-100"><?php echo e(__('Save Changes')); ?></button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

        </div>
    </div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script src="<?php echo e(asset('backend/js/choices.min.js')); ?>"></script>
    <script>
        $(document).ready(function(){
            "use strict";

            new Choices('#section_id', {
                removeItemButton: true
            });
        })
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('backend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/mxawfis.atharvatek.com/resources/views/backend/page/edit.blade.php ENDPATH**/ ?>