<?php $__env->startSection('mainContent'); ?>
    <?php echo generateBreadcrumb(); ?>


    <section class="admin-visitor-area">
        <div class="container-fluid p-0">
            <?php if(isset($editData)): ?>
                <div class="row">
                    <div class="offset-lg-10 col-lg-2 text-end col-md-12 mb-20"><a target="_blank"
                                                                                   href="<?php echo e(route('frontPage',$editData->slug)); ?>"
                                                                                   class="primary-btn small fix-gr-bg"> <span
                                class="ti-eye pe-2"></span> <?php echo e(__('student.Preview')); ?> </a></div>
                </div>
            <?php endif; ?>


            <div class="row">
                <div class="col-lg-12">

                    <div class="white-box  student-details header-menu">
                        <?php if(isset($editData)): ?>
                            <form class="form-horizontal" method="POST" action="<?php echo e(route('frontend.page.update', $editData->id)); ?>" enctype="multipart/form-data">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('PUT'); ?>
                                <?php else: ?>
                                    <form class="form-horizontal" method="POST" action="<?php echo e(route('frontend.page.store')); ?>" enctype="multipart/form-data" id="search_studentA">
                                        <?php echo csrf_field(); ?>
                                        <?php endif; ?>

                                        <div class="row">
                                            <div class="col-lg-12">
                                                <?php
                                                    $LanguageList = getLanguageList();
                                                ?>
                                                <div class="row pt-0">
                                                    <?php if(isModuleActive('FrontendMultiLang')): ?>
                                                        <ul class="nav nav-tabs no-bottom-border  mt-sm-md-20 mb-10 ms-3"
                                                            role="tablist">
                                                            <?php $__currentLoopData = $LanguageList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                <li class="nav-item">
                                                                    <a class="nav-link  <?php if(auth()->user()->language_code == $language->code): ?> active <?php endif; ?>"
                                                                       href="#element<?php echo e($language->code); ?>"
                                                                       role="tab"
                                                                       data-bs-toggle="tab"><?php echo e($language->native); ?>  </a>
                                                                </li>
                                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </ul>
                                                    <?php endif; ?>
                                                </div>
                                                <div class="tab-content">
                                                    <?php $__currentLoopData = $LanguageList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <div role="tabpanel"
                                                             class="tab-pane fade <?php if(auth()->user()->language_code == $language->code): ?> show active <?php endif; ?>  "
                                                             id="element<?php echo e($language->code); ?>">
                                                            <div class="row">
                                                                <div class="col-lg-12  ">
                                                                    <div class="primary_input mb-25">
                                                                        <label
                                                                            class="'primary_input_label mb-2"><?php echo e(__('frontendmanage.Title')); ?>

                                                                            <span class="required_mark">*</span> </label>
                                                                        <input
                                                                            class="primary_input_field form-control<?php echo e($errors->has('title') ? ' is-invalid' : ''); ?>  <?php if(auth()->user()->language_code == $language->code): ?> addTitleActive <?php endif; ?>"
                                                                            type="text" name="title[<?php echo e($language->code); ?>]"
                                                                            autocomplete="off"
                                                                            value="<?php echo e(isset($editData)? $editData->getTranslation('title',$language->code) : ''); ?>">

                                                                        <span class="focus-border"></span>
                                                                        <?php if($errors->has('title')): ?>
                                                                            <span class="invalid-feedback" role="alert">
                                                            <strong><?php echo e($errors->first('title')); ?></strong>
                                                        </span>
                                                                        <?php endif; ?>
                                                                    </div>
                                                                </div>

                                                                <div class="col-lg-12 ">
                                                                    <div class="primary_input mb-25">
                                                                        <label
                                                                            class="'primary_input_label mb-2"><?php echo e(__('frontendmanage.Sub Title')); ?> </label>
                                                                        <input
                                                                            class="primary_input_field form-control<?php echo e($errors->has('sub_title') ? ' is-invalid' : ''); ?>"
                                                                            type="text" name="sub_title[<?php echo e($language->code); ?>]"
                                                                            autocomplete="off"
                                                                            value="<?php echo e(isset($editData)? $editData->getTranslation('sub_title',$language->code) : ''); ?>">

                                                                        <span class="focus-border"></span>
                                                                        <?php if($errors->has('sub_title')): ?>
                                                                            <span class="invalid-feedback" role="alert">
                                                            <strong><?php echo e($errors->first('sub_title')); ?></strong>
                                                        </span>
                                                                        <?php endif; ?>
                                                                    </div>
                                                                </div>
                                                                <?php if(!hasDynamicPage()): ?>
                                                                    <div class="col-lg-12 ">
                                                                        <div class="primary_input mb-25">
                                                                            <label
                                                                                class="'primary_input_label mb-2"><?php echo e(__('frontendmanage.Details')); ?>

                                                                                <span class="required_mark">*</span> </label>
                                                                            <textarea
                                                                                class="form-control lms_summernote <?php echo e($errors->has('details') ? ' is-invalid' : ''); ?>"
                                                                                rows="5" name="details[<?php echo e($language->code); ?>]" cols="50"
                                                                                style="display: none;"><?php echo e(isset($editData)? $editData->getTranslation('details',$language->code) : ''); ?></textarea>

                                                                            <span class="focus-border"></span>
                                                                            <?php if($errors->has('details')): ?>
                                                                                <span class="invalid-feedback" role="alert">
                                                            <strong><?php echo e($errors->first('details')); ?></strong>
                                                        </span>
                                                                            <?php endif; ?>
                                                                        </div>
                                                                    </div>
                                                                <?php endif; ?>

                                                            </div>
                                                        </div>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </div>
                                                <div class="row">
                                                    <?php if(!isset($editData) ||  (isset($editData) && $editData->is_static!=1)): ?>

                                                        <div class="col-lg-12 ">
                                                            <div class="primary_input mb-25">
                                                                <label
                                                                    class="'primary_input_label mb-2"><?php echo e(__('frontendmanage.Slug')); ?> </label>
                                                                <input
                                                                    class="primary_input_field form-control<?php echo e($errors->has('slug') ? ' is-invalid' : ''); ?> addSlug"
                                                                    type="text" name="slug" autocomplete="off"
                                                                    value="<?php echo e(isset($editData)? $editData->slug : ''); ?>">

                                                                <span class="focus-border"></span>
                                                                <?php if($errors->has('sub_title')): ?>
                                                                    <span class="invalid-feedback" role="alert">
                                                            <strong><?php echo e($errors->first('slug')); ?></strong>
                                                        </span>
                                                                <?php endif; ?>
                                                            </div>
                                                        </div>
                                                    <?php endif; ?>
                                                    <?php if(!hasDynamicPage()): ?>
                                                        <div class="col-xl-8  ">
                                                            <div class="primary_input mb-25">
                                                                <label class="primary_input_label"
                                                                       for="">
                                                                </label>
                                                                <div class="primary_file_uploader">
                                                                    <input
                                                                        class="primary_input_field  filePlaceholder <?php echo e(@$errors->has('banner') ? ' is-invalid' : ''); ?>"
                                                                        type="text" id=""
                                                                        placeholder="<?php echo e(__('setting.Browse file')); ?>"
                                                                        readonly="" <?php echo e($errors->has('instructor_banner') ? ' autofocus' : ''); ?>>
                                                                    <button class="" type="button">
                                                                        <label class="primary-btn small fix-gr-bg"
                                                                               for="file1"><?php echo e(__('frontendmanage.Banner')); ?></label>
                                                                        <input type="file" class="d-none fileUpload imgInput1"
                                                                               name="banner" id="file1">
                                                                    </button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="col-xl-4  ">
                                                            <div class="primary_input mb-25">
                                                                <img height="70" class=" imagePreview1" style="max-width: 100%"
                                                                     src="<?php if(isset($editData)): ?><?php echo e(asset('/'.$editData->banner)); ?><?php endif; ?>"
                                                                     alt="">
                                                            </div>
                                                        </div>
                                                    <?php endif; ?>
                                                </div>
                                            </div>

                                            <?php if(isset($editData)): ?>
                                                <div class="col-lg-12 mt-40 text-center tooltip-wrapper">
                                                    <button class="primary-btn fix-gr-bg tooltip-wrapper ">
                                                        <i class="ti-check"></i>
                                                        <?php echo e(__('common.Update')); ?>

                                                    </button>
                                                </div>

                                            <?php else: ?>

                                                <div class="col-lg-12 mt-40 text-center tooltip-wrapper">
                                                    <button class="primary-btn fix-gr-bg tooltip-wrapper " type="submit">
                                                        <i class="ti-check"></i>
                                                        <?php echo e(__('common.Add')); ?>

                                                    </button>
                                                </div>

                                            <?php endif; ?>

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

        </div>
    </section>

<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
    <script>

        $('.popover').css("display", "none");

        function readURL1(input) {
            if (input.files && input.files[0]) {
                var reader = new FileReader();
                reader.onload = function (e) {
                    $(".imagePreview1").attr('src', e.target.result);
                }
                reader.readAsDataURL(input.files[0]); // convert to base64 string
            }
        }

        $(".imgInput1").change(function () {
            readURL1(this);
        });

        $(".addTitleActive").on('input', function () {
            let title = $(".addTitleActive").val();
            $(".addSlug").val(convertToSlug(title));
        });

        function convertToSlug(Text) {
            return Text
                .toLowerCase()
                .replace(/ /g, '-')
                .replace(/[^\w-]+/g, '')
                ;
        }
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('backend.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/minialms/card.minialms.com/Modules/FrontendManage/Resources/views/front_page/create.blade.php ENDPATH**/ ?>