Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/storage/framework/views/a99fa68e62dbd764f236592f5ea4257f.php
Назад
<?php $__env->startSection('title', 'Edit Category'); ?> <?php $__env->startPush('admin-styles'); ?> <?php $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <div class="container-xxl flex-grow-1 container-p-y"> <div class="row"> <div class="col-lg-12 col-md-12 col-sm-8 col-xs-9 bhoechie-tab-container" style="background-color:white;"> <div class="row"> <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 bhoechie-tab-menu"> <div class="list-group"> <a href="#" class="list-group-item active text-center"> <i class="fas fa-pen"></i><br />Page Fields </a> <a href="#" class="list-group-item text-center d-none"> <i class="fas fa-angle-left"></i>/<i class="fas fa-angle-right"></i><br />Page Builder </a> <a href="#" class="list-group-item text-center"> <i class="fas fa-image"></i><br />Slider Upload </a> </div> </div> <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 bhoechie-tab"> <!-- Edit Category Form --> <div class="bhoechie-tab-content active"> <div class="p-5 mb-4"> <h5 class="card-header">Edit Category </h5> <div class="card-body"> <form action="<?php echo e(route('category.update.data', $category->id)); ?>" method="POST" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <?php echo $__env->make('partials.alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <div class="row"> <div class="col-md-6 mb-6"> <label class="form-label">Title <i class="fa fa-asterisk small-font text-danger" aria-hidden="true"></i> </label> <input type="text" class="form-control" name="title" value="<?php echo e(old('title', $category->title)); ?>" placeholder="Enter title" /> </div> <div class="col-md-6 mb-6"> <label class="form-label">Slug <small>(Page URL)</small> <i class="fa fa-asterisk small-font text-danger" aria-hidden="true"></i> </label> <input type="text" class="form-control" name="slug" value="<?php echo e(old('slug', $category->slug)); ?>" placeholder="Slug" /> </div> </div> <div class="row mt-3"> <div class="col-md-12 mb-12"> <label for="exampleFormControlTextarea1" class="form-label">Short Description <i class="fa fa-asterisk small-font text-danger" aria-hidden="true"></i> </label> <textarea name="short_description" id="div-short-editor"> <?php echo e(old('short_description', $category->short_description)); ?> </textarea> </div> </div> <div class="row mt-3"> <div class="col-md-12 mb-6"> <label class="form-label">Featured Image <small>(show category page)</small> <i class="fa fa-asterisk small-font text-danger" aria-hidden="true"></i></label> <input class="form-control" type="file" name="featured_image" id="open-image-form-File" onchange="previewOpenGraphUpdate()" accept=".png, .jpeg, .jpg"> </div> <?php if($category->getMedia('featured_image')->isNotEmpty()): ?> <img id="existingOpenImage" src="<?php echo e($category->getFirstMediaUrl('featured_image')); ?>" width="300" height="200" class="img-fluid img-thumbnail" style="width:200px" /> <?php endif; ?> <img id="open-image-frame" src="" class="img-fluid img-thumbnail" /> </div> <div class="row mt-3"> <div class="col-md-6 mb-6"> <label class="form-label">Status <i class="fa fa-asterisk small-font text-danger" aria-hidden="true"></i> </label> <select name="status" id="status" class="form-select"> <option value="1" <?php if(old('status', $category->status) == 1): ?> selected <?php endif; ?>>Active</option> <option value="0" <?php if(old('status', $category->status) == 0): ?> selected <?php endif; ?>>Inactive</option> </select> </div> </div> <?php echo $__env->make('admin.seo.update', ['model' => $category], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> <div class="row mt-3"> <div class="col-md-12"> <a href="<?php echo e(route('categories')); ?>" class="btn btn-danger redirect-btn">Back</a> <button type="submit" class="btn btn-primary" onclick="showLoader()">Update</button> </div> </div> </form> </div> </div> </div> <div class="bhoechie-tab-content"> <div class="col-md-12 mb-6"> <label class="switch switch-success"> <input name="is_page_builder" type="checkbox" class="switch-input" <?php echo e($category->is_page_builder ? 'checked' : ''); ?> /> <span class="switch-toggle-slider"> <span class="switch-on"> <i class="bx bx-check"></i> </span> <span class="switch-off"> <i class="bx bx-x"></i> </span> </span> <span class="switch-label">Published Page Builder</span> <br> <small>Note: By default, the long description text editor is placed at the detail of each page. If Published Page Builder is checked, the long description will be replaced with the page builder.</small> </label> </div> <div class="col-md-12 mb-6"> <div id="web-builder" data-primary-id="<?php echo e($category->id); ?>" data-app-url="<?php echo e(config('app.url')); ?>/category"></div> </div> </div> <div class="bhoechie-tab-content"> <div class="p-5 mb-4"> <h5 class="card-header mb-3">Upload Slider <small>Maximum of 5 files allowed</small></h5> <div class="card-body"> <div class="col-12"> <div class="card"> <div class="card-body"> <div class="row mt-3"> <div class="col-md-12 mb-5"> <input type="hidden" id="existing-file-count" value="<?php echo e($category->getMedia('sliders')->count()); ?>"> <div class="dropzone needsclick" id="dropzone-slider" data-category-id="<?php echo e($category->id); ?>"> <div class="dz-message needsclick"> Drop files here or click to upload </div> <!-- Add the input file field --> <input type="file" name="file" style="display: none;" accept=".png, .jpeg, .jpg"> </div> </div> </div> <div class="row"> <div class="col-md-12 mb-2"> <?php echo $__env->make('admin.categories.slider_list', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> </div> </div> </div> </div> </div> </div> </div> </div> <div class="bhoechie-tab-content"> <div class="p-5 mb-4"> <h5 class="card-header mb-3">Photo & Video gallery</h5> <div class="card-body"> <div class="col-12"> <div class="card"> <div class="card-body"> <div class="row mt-3"> <div class="col-md-12 mb-5"> <div class="dropzone needsclick" id="dropzone-multi" data-category-id="<?php echo e($category->id); ?>"> <div class="dz-message needsclick"> Drop files here or click to upload </div> <!-- Add the input file field --> <input type="file" name="file" style="display: none;" accept=".png, .jpeg, .jpg"> </div> </div> </div> <div class="row mt-1"> <div class="col-md-12 mb-2"> <b>Note:</b> <span style="font-size: 12px;">(The <b>alternate text</b>, which serves as content for screen readers, search engines, and when images fail to load, also functions as a tooltip for mouse hover interactions.)</span> </div> </div> <div class="row"> <div class="col-md-12 mb-2"> <?php echo $__env->make('admin.categories.file_list', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startPush('admin-scripts'); ?> <script> $(document).ready(function() { $("div.bhoechie-tab-menu>div.list-group>a").click(function(e) { e.preventDefault(); $(this).siblings('a.active').removeClass("active"); $(this).addClass("active"); var index = $(this).index(); $("div.bhoechie-tab>div.bhoechie-tab-content").removeClass("active"); $("div.bhoechie-tab>div.bhoechie-tab-content").eq(index).addClass("active"); }); // Function to generate a slug from a given string function generateSlug(str) { return str .toLowerCase() .replace(/ /g, '-') .replace(/[^\w-]+/g, ''); } // Event listener for the title input field $('input[name="title"]').on('input', function() { var titleValue = $(this).val(); var slugValue = generateSlug(titleValue); var fullSlug = slugValue; $('input[name="slug"]').val(fullSlug); }); }); </script> <script> let existingFileCount = parseInt($('#existing-file-count').val(), 10); Dropzone.autoDiscover = false; $(document).ready(function() { const previewTemplate = `<div class="dz-preview dz-file-preview"> <div class="dz-details"> <div class="dz-thumbnail"> <img data-dz-thumbnail> <span class="dz-nopreview">No preview</span> <div class="dz-success-mark"></div> <div class="dz-error-mark"></div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="progress"> <div class="progress-bar progress-bar-primary" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-dz-uploadprogress></div> </div> </div> <div class="dz-filename" data-dz-name></div> <div class="dz-size" data-dz-size></div> </div> </div>`; var id = $('#dropzone-multi').data('category-id'); var url = "<?php echo e(route('category.upload.slider', ':id')); ?>"; url = url.replace(':id', id); var dropzoneConfig = { previewTemplate: previewTemplate, headers: { 'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>", }, parallelUploads: 1, maxFilesize: 15, maxFiles: 5, url: url, method: "post", autoProcessQueue: true, uploadMultiple: true, acceptedFiles: 'image/jpeg,image/png,image/jpg', error: function(file, response) { if (file.size > this.options.maxFilesize * 1024 * 1024) { Swal.fire({ title: "File Too Large", text: `File "${file.name}" exceeds the maximum upload size of 15 MB.`, icon: "error" }); this.removeFile(file); } }, // Event handler for file added addedfile: function(file) { let totalFiles = this.files.length + existingFileCount; // Check if adding this file would exceed the limit if (totalFiles > 5) { // Calculate how many files need to be removed let excessFiles = totalFiles - 5; // Remove the excess files, starting with the newly added files for (let i = 0; i < excessFiles; i++) { let fileToRemove = this.files[this.files.length - 1 - i]; this.removeFile(fileToRemove); } Swal.fire({ title: "Oops!", text: "You can only upload up to 5 files.", icon: "error" }); } } }; var myDropzone = new Dropzone("#dropzone-slider", dropzoneConfig); myDropzone.on("success", function(file, response) { existingFileCount++; $('#existing-file-count').val(existingFileCount); this.removeFile(file); if (response.html) { $("#slider-list").prepend(response.html); $("#save-slider-row").show(); } }); }); </script> <script> $(document).ready(function() { // Handle click event on the "Save All" button $(document).on('click', '#save-all-sliders', function() { var data = []; var allFieldsFilled = true; // Loop through each row in the table $('#slider-list tbody tr').each(function() { var row = $(this); var mediaId = row.data('media-id'); var alternateTextInput = row.find('.alternate-text-input'); var captionText = row.find('.caption-text-input').val(); if (alternateTextInput.val().trim() === '') { allFieldsFilled = false; if (!row.find('.error-message').length) { alternateTextInput.after( '<span class="error-message text-danger d-block text-start">Alternate text filed is required.</span>' ); } alternateTextInput.addClass('is-invalid'); } else { row.find('.error-message').remove(); alternateTextInput.removeClass('is-invalid'); } data.push({ media_id: mediaId, alternate_text: alternateTextInput.val(), caption_text: captionText }); }); if (!allFieldsFilled) { return; } // Send an AJAX request to update alternate text and captions for all sliders $.ajax({ method: 'POST', url: '<?php echo e(route('category.update.alternatetext.slider')); ?>', data: { data: data }, headers: { 'X-CSRF-TOKEN': "<?php echo e(csrf_token()); ?>", }, success: function(response) { Swal.fire('Updated!', response.success, 'success'); }, error: function(error) { // Handle the error (e.g., show an error message) console.error('Error saving alternate text:', error); } }); }); }); </script> <script> // Handle delete button click using jQuery $(document).ready(function() { $(document).on('click', '.slider-delete-media-item', function() { const button = $(this); const row = button.closest('tr'); const mediaId = row.data('media-id'); Swal.fire({ title: 'Delete Media Item?', text: 'Are you sure you want to delete this media item?', icon: 'warning', showCancelButton: true, confirmButtonColor: '#d33', cancelButtonColor: '#3085d6', confirmButtonText: 'Yes, delete it!', cancelButtonText: 'Cancel' }).then((result) => { if (result.isConfirmed) { existingFileCount--; $('#existing-file-count').val(existingFileCount); deleteMediaItem(mediaId, row); } }); }); // Function to delete media item via AJAX function deleteMediaItem(mediaId, row) { const deleteUrl = "<?php echo e(route('destination.update.delete.media.slider', ['id' => ':mediaId'])); ?>" .replace(':mediaId', mediaId); $.ajax({ url: deleteUrl, type: 'DELETE', headers: { 'X-CSRF-TOKEN': '<?php echo e(csrf_token()); ?>' }, success: function(data) { if (data.message) { // Media item deleted successfully row.remove(); Swal.fire('Deleted!', data.message, 'success'); } else { // Handle the case where deletion failed Swal.fire('Error', data.error, 'error'); } }, error: function(xhr, status, error) { // Handle any errors that occur during the request console.error('Error:', error); Swal.fire('Error', 'An error occurred while deleting the media item.', 'error'); } }); } }); </script> <?php $__env->stopPush(); ?> <?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/clickysoft/public_html/travel-guru.clickysoft.net/resources/views/admin/categories/update.blade.php ENDPATH**/ ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка