<?php $__env->startSection('content'); ?>
    <div class="side-title">
        <h3><?php echo e($head ?? ''); ?></h3>
    </div>

    <div class="border-item">
        <form class="form-row" method="post" onsubmit="saveForm(this)" action="<?php echo e($action); ?>" enctype="multipart/form-data">
            <?php if($attribute ?? ''  && $attribute->id): ?>
                <?php echo method_field('PUT'); ?>
            <?php endif; ?>
            <?php echo csrf_field(); ?>

                <div class="form-group col-lg-6">
                    <label><?php echo e(__('attributes.status')); ?> </label>
                    <select onchange="changeStatus()" id="status"  class="form-control <?php echo e($errors->has('status') ? 'is-invalid' : ''); ?>" name="status">
                        <?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option <?php echo e((isset($attribute) ? $attribute->status : null) == $row ? 'selected' : ''); ?> value="<?php echo e($row); ?>"><?php echo e(__('attributes.statuses.'.$row)); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                <div class="form-group col-lg-6" id="color">
                    <label><?php echo e(__('attributes.color')); ?> </label>
                    <input type="color" class="form-control <?php echo e($errors->has('color') ? 'is-invalid' : ''); ?>" name="color" placeholder="<?php echo e(__('attributes.color')); ?>" value='<?php echo e(old("color", $attribute->color ?? "")); ?>'/>
                </div>

            <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <div class="form-group col-lg-6">
                    <label><?php echo e(meta('title', $language->local) ?? __('attributes.title')); ?> <?php echo e(count($languages) > 1 ? "({$language->name})" : ''); ?> </label>
                    <input type="text" class="form-control <?php echo e($errors->has('title_'.$language->local) ? 'is-invalid' : ''); ?>" name="title_<?php echo e($language->local); ?>" placeholder="<?php echo e(meta('title', $language->local) ?? __('attributes.title')); ?>" value='<?php echo e(old("title_{$language->local}", $attribute[$language->local]->title ?? "")); ?>'/>
                </div>

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

            <div class="text-center mt-5 col-12">
                <button class="butn"><span><?php echo e(__('dashboard.save')); ?></span></button>
            </div>
        </form>
    </div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
    <!-- Editor JS orders -->
    <script src="<?php echo e(asset('/assets/admin/js/lib/tinymce.min.js')); ?>"></script>
    <script>
        function changeStatus(){
            let status = $('#status').val()
            if(status == "<?php echo e(\Modules\Attribute\Enums\AttributeStatusEnum::COLOR->value); ?>")
            {
                $('#color').show()
            }
            else
            {
                $('#color').hide()
            }
        }
        $('#status').trigger('change')
    </script>
    <script>
        let route_prefix = "<?php echo e(url(config('lfm.prefix'))); ?>",
            url = "<?php echo e(url('/')); ?>/",
            currentLanguage = "<?php echo e(getCurrentLocale()); ?>",
            imagePath = "<?php echo e(asset('')); ?>";
    </script>
    <script src="<?php echo e(asset('assets/admin/js/editor.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/lfm.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/admin/js/articles.js')); ?>"></script>
<?php $__env->stopSection(); ?>




<?php echo $__env->make('admin.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/omaralyomhost/public_html/rose/resources/views/admin/attributes/form.blade.php ENDPATH**/ ?>