
<?php $__env->startSection('content'); ?>
    <script src="https://cdn.tiny.cloud/1/rcjw03tjfu0hq8dkm2bkb8qcwhd4nyavx70mdvyk6t6a8uzl/tinymce/6/tinymce.min.js"
        referrerpolicy="origin"></script>
    <div class="row match-height">
        <div class="col-md-12 col-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title text-primary">Editando Página</h4>
                    <p class="text-muted">Editando Páginas no Sistema</p>
                    <a class="btn btn-outline-primary btn-block d-grid gap-2" type="button"
                        href="<?php echo e(route('paginas.index')); ?>" role="button">Ver todas</a>
                </div>
                <div class="card">
                    <div class="card-body">
                        <form action="<?php echo e(route('paginas.update', $paginas->id)); ?>" method="POST" class="form-horizontal">
                            <?php echo method_field('PUT'); ?>
                            <?php echo csrf_field(); ?>
                            <div class="box box-info">
                                <div class="form-group">
                                    <label class="col-form-label">Nome da página <span>*</span></label>
                                    <input type="text" name="nome" value="<?php echo e($paginas->nome); ?>"
                                        class="form-control <?php $__errorArgs = ['nome'];
$__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="form-group w">
                                    <label class="col-form-label">Slug <span>*</span></label>
                                    <input type="text" name="slug" value="<?php echo e($paginas->slug); ?>"
                                        class="form-control <?php $__errorArgs = ['slug'];
$__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>
                            <div class="form-group">
                                <label class="col-form-label">Layout</label>
                                <select name="layout" class="form-control select2 <?php $__errorArgs = ['layout'];
$__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); ?>"
                                    onchange="showContentInputArea(this)">
                                    <option value="Layout de Página Inteira"
                                        <?php if($paginas->layout == 'Layout de Página Inteira'): ?> selected <?php endif; ?>>
                                        Layout de Página Inteira</option>
                                    <option value="Layout FAQ" <?php if($paginas->layout == 'Layout FAQ'): ?> selected <?php endif; ?>>Layout FAQ
                                    </option>
                                    <option value="Layout Agentes Políticos"
                                        <?php if($paginas->layout == 'Layout Agentes Políticos'): ?> selected <?php endif; ?>>
                                        Layout Agentes Políticos</option>
                                    <option value="Layout Galeria de Fotos"
                                        <?php if($paginas->layout == 'Layout Galeria de Fotos'): ?> selected <?php endif; ?>>
                                        Layout Galeria de Fotos</option>
                                    <option value="Layout Galeria de Vídeos"
                                        <?php if($paginas->layout == 'Layout Galeria de Vídeos'): ?> selected <?php endif; ?>>
                                        Layout Galeria de Vídeos</option>
                                    <option value="Layout de Blog" <?php if($paginas->layout == 'Layout de Blog'): ?> selected <?php endif; ?>>Layout
                                        de
                                        Blog</option>
                                    <option value="Layout de Contato" <?php if($paginas->layout == 'Layout de Contato'): ?> selected <?php endif; ?>>
                                        Layout
                                        de Contato</option>
                                </select>
                                <script type="text/javascript">
                                    function showContentInputArea(elem) {
                                        if (elem.value == 'Layout de Página Inteira') {
                                            document.getElementById('showPageContent').style.display = "block";
                                        } else {
                                            document.getElementById('showPageContent').style.display = "none";
                                        }
                                    }
                                </script>
                            </div>
                            <div class="form-group" id="showPageContent">
                                <label class="col-form-label">Conteúdo </label>
                                <textarea type="textarea" id="mytextarea" class="form-control <?php $__errorArgs = ['conteudo'];
$__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); ?>" rows="5"
                                    name="conteudo"><?php echo e($paginas->conteudo); ?></textarea>
                            </div>
                            <div class="form-group">
                                <label class="col-form-label">Ativa? </label>
                                <br>
                                <label class="radio-inline">
                                    <input type="radio" name="status" value="Ativa" checked> Sim
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="status" value="Inativa"> Não
                                </label>
                            </div>
                            <h4 class="seo-info">SEO Informações</h4>
                            <div class="form-group">
                                <label class="col-form-label">Meta Título </label>
                                <input type="text" class="form-control <?php $__errorArgs = ['meta_titulo'];
$__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); ?>"
                                    name="meta_titulo" value="<?php echo e($paginas->meta_titulo); ?>">
                            </div>
                            <div class="form-group">
                                <label class="col-form-label">Meta Keywords </label>
                                <textarea class="form-control <?php $__errorArgs = ['meta_keyword'];
$__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); ?>" name="meta_keyword" rows="2"><?php echo e($paginas->meta_keyword); ?></textarea>
                            </div>
                            <div class="form-group">
                                <label class="col-form-label">Meta Descrição </label>
                                <textarea class="form-control <?php $__errorArgs = ['meta_descricao'];
$__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); ?>" name="meta_descricao" rows="2"><?php echo e($paginas->meta_descricao); ?></textarea>
                            </div>
                            <br>
                            <div class="form-group">
                                <button type="submit" class="btn btn-outline-success btn-sm w-100"
                                    name="form1">Gravar</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
         tinymce.init({
            selector: '#mytextarea',
            plugins: 'image',
            toolbar: 'undo redo | image | bold italic',
            automatic_uploads: true,
            images_upload_url: '/upload-image', // URL de upload das imagens
            file_picker_types: 'image', // Tipos de arquivos permitidos
            language: 'pt_BR', // Define o idioma para português do Brasil
            content_css: 'https://www.tiny.cloud/css/codepen.min.css', // (opcional) Um exemplo de estilo
            headers: {
                'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' // Passando o CSRF Token
            },
            file_picker_callback: function(callback, value, meta) {
                // Customize the file picker if necessary
            }
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\portalmunicipal\resources\views/admin/paginas/edit.blade.php ENDPATH**/ ?>