OwlCyberSecurity - MANAGER
Edit File: 24dc89e01de6c81ed7b4b232d050fee1.php
<?php $__env->startSection('content'); ?> <style> .error_div { background-color: #ffc8c8; border-radius: 4px; padding: 0.4rem; padding-left: 1rem; color: #f11a1a; border: 1px solid #ff2a2a; } .success_div { background-color: #aedcaf; border-radius: 4px; padding: 0.4rem; padding-left: 1rem; color: #1f6d26; border: 1px solid #248526; } </style> <div class="row p-2"> <div class="col-12"> <h3>Edit Blog</h3> </div> <div class="col" id="blogEditMessageDiv" style="display: none;"></div> </div> <div class="row p-2"> <div class="col-12"> <div class="card"> <div class="card-body"> <div class="row"> <?php if(!empty($errors->all())): ?> <div class="col-12 error_div"> <?php echo e($errors->first()); ?> </div> <?php endif; ?> <?php if(session()->has('message')): ?> <div class="col-12 error_div"> <?php echo e(session()->get('message')); ?> </div> <?php endif; ?> <?php if(session()->has('success')): ?> <div class="col-12 success_div"> <?php echo e(session()->get('success')); ?> </div> <?php endif; ?> </div> <form action="<?php echo e(route('update_blog.edit_blogs', ['id' => $blog->id])); ?>" method="POST" autocomplete="off" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12"> <div class="form-group"> <label for="title" class="form-label">Title</label> <input type="text" name="title" id="title" class="form-control" autofocus value="<?php echo e(old('title') ?? $blog->title); ?>"> </div> <div class="form-group"> <label for="slug" class="form-label">Slug</label> <input type="text" name="slug" id="slug" class="form-control" autofocus value="<?php echo e(old('slug') ?? $blog->slug); ?>"> </div> <div class="form-group"> <label for="short_description" class="form-label">Short Description</label> <textarea name="short_description" id="short_description"><?php if(old('short_description')): ?><?php echo e(old('short_description')); ?><?php elseif(!empty($blog->short_description)): ?><?php echo e($blog->short_description); ?><?php endif; ?> </textarea> </div> <div class="form-group"> <label for="content" class="form-label">Content</label> <textarea name="content" id="content"><?php if(old('content')): ?><?php echo e(old('content')); ?><?php elseif(!empty($blog->content)): ?><?php echo e($blog->content); ?><?php endif; ?></textarea> </div> <div class="form-group"> <label for="meta_title" class="form-label">Meta Title</label> <input type="text" name="meta_title" id="meta_title" class="form-control" autofocus value="<?php echo e(old('meta_title') ?? $blog->meta_title); ?>"> </div> <div class="form-group"> <label for="meta_description" class="form-label">Meta Description</label> <textarea name="meta_description" class="form-control" rows="5" id="meta_description"><?php if(old('meta_description')): ?><?php echo e(old('meta_description')); ?><?php elseif(!empty($blog->meta_description)): ?><?php echo e($blog->meta_description); ?><?php endif; ?></textarea> </div> <div class="form-group"> <label for="meta_keywords" class="form-label">Meta Keywords</label> <textarea name="meta_keywords" class="form-control" rows="5" id="meta_keywords"><?php if(old('meta_keywords')): ?><?php echo e(old('meta_keywords')); ?><?php elseif(!empty($blog->meta_keywords)): ?><?php echo e($blog->meta_keywords); ?><?php endif; ?></textarea> </div> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <div class="row mt-2"> <div class="col-lg-6 col-md-6 col-sm-12"> <label for="status" class="form-label">Status</label> <br> <label><input type="radio" name="status" <?php echo e((old('status') != null && old('status') == 1 ? 'checked' : ($blog->status == 1 ? 'checked' : ''))); ?> value="1" style="vertical-align: middle;"> Active </label> <label><input type="radio" name="status" <?php echo e((old('status') != null && old('status') == 0 ? 'checked' : ($blog->status == 0 ? 'checked' : ''))); ?> value="0" style="vertical-align: middle;"> Inactive</label> </div> </div> <div class="form-group"> <label for="is_featured" class="form-label">Authentications</label> <br> <label><input type="checkbox" name="is_featured" <?php echo e(old('is_featured') == 1 ? 'checked' : ($blog->is_featured == 1 ? 'checked' : '')); ?> value="1" style="vertical-align: middle;"> Is Featured? </label> </div> <div class="form-group"> <label class="form-label">Show In</label> <br> <label><input type="checkbox" name="show_in_slider" <?php echo e(old('show_in_slider') == 1 ? 'checked' : ($blog->show_in_slider == 1 ? 'checked' : '')); ?> value="1" style="vertical-align: middle;"> Slider </label> <label><input type="checkbox" name="show_in_sidebar" <?php echo e(old('show_in_sidebar') == 1 ? 'checked' : ($blog->show_in_sidebar == 1 ? 'checked' : '')); ?> value="1" style="vertical-align: middle;"> Side menu </label> </div> <div class="form-group"> <label>Category</label> <select name="category_id" id="category_id" class="form-control"> <option value="0">Select</option> <?php foreach ($categories as $catid => $cat_name) { ?> <option value="<?php echo e($catid); ?>" <?php echo e((old('category_id') == $catid ? 'selected' : ($blog->category_id == $catid ? 'selected' : ''))); ?>><?php echo e($cat_name); ?></option> <?php } ?> </select> </div> <div class="form-group"> <label for="external_link" class="form-label">External Link</label> <input type="text" name="external_link" id="external_link" class="form-control" autofocus value="<?php echo e(old('external_link') ? old('external_link') : ''); ?>"> </div> <div class="form-group"> <label>Link Target</label> <select name="link_target" class="form-control"> <option value="0">Select</option> <option value="1" selected>_self</option> <option value="2">_blank</option> </select> </div> <div class="form-group"> <label for="image" class="form-label">Image</label> <?php if(isset($blog->header_image) && !empty($blog->header_image)): ?> <div class="mb-4" id="image_holder"> <div class="row"> <div class="text-right" style="width: 220px;" id="image_delete_icon_holder"> <i class="fa fa-times" aria-hidden="true" style="cursor: pointer;" title="delete image" onclick="deleteImage('<?php echo e($blog->id); ?>')"></i> </div> <div class="col-12"> <img src="<?php echo e(url('storage/blog_images/'.$blog->header_image)); ?>" alt="Blog image" width="200px"> </div> </div> </div> <?php endif; ?> <div> <input type="file" name="image" id="image"> </div> <small>(Max image size: 1 MB; Max Dimension: 1132 x 250 pixels; Image types allowed: jpg, jpeg, gif, png.)</small> </div> <div class="form-group"> <button type="submit" class="custom-blue-btn width-5-rem " id="form-submit-button">Save</button> <a href="<?php echo e(route('update_blog.edit_blogs', ['id' => $blog->id])); ?>"><button type="button" class="custom-grey-btn width-5-rem">Cancel</button></a> </div> </div> </div> </form> </div> </div> </div> </div> <script> // for messages function BlogEditMessage(type = '', message = '', timeout = 3000) { var selectedClass = ''; var holder = $('#blogEditMessageDiv'); if (type.toLowerCase() == 'success') { selectedClass = 'success_div'; } else { selectedClass = 'error_div'; } var ht = `<div class="${selectedClass}">${message}</div>`; holder.html(ht); holder.hide().show().fadeIn('fast').delay(timeout).fadeOut('slow', function() { $(this).stop(true); }); } // delete image function deleteImage(id) { $.ajax({ url: "<?php echo e(route('post_blog_delete_image.delete_blog' , ['id' => 'blogID' ])); ?>/".replace('blogID', id), type: "POST", dataType: "JSON", data: { _token: "<?php echo e(csrf_token()); ?>" }, beforeSend: function() { $('#image_delete_icon_holder').html('<span class="spinner-border" style="width: 15px; height: 15px;"></span>'); $('#form-submit-button').hide(); }, success: function(res) { BlogEditMessage('success', res.message); $('#image_holder').remove(); }, error: function(res) { BlogEditMessage('message', res.responseJSON.message); console.log(res.responseJSON.message); }, complete: function() { $('#form-submit-button').show(); } }) } // document ready start $(document).ready(function() { $('#slug').change(function() { var str = $(this).val(); str = str.replace(/\s+/g, '-').toLowerCase(); $('#slug').val(str); }); $('#short_description, #content').summernote({ placeholder: '<small>Description...</small>', tabsize: 2, height: 100, // toolbar: [ // // [groupName, [list of button]] // ['style', ['bold', 'italic', 'underline']], // ['font', ['strikethrough']], // ['fontsize', ['fontsize']], // ['color', ['color']], // ], disableDragAndDrop: false, callbacks: { onImageUpload: function(data) { data.pop(); } }, }); // $('#tags , #keywords').select2({ // tags: true, // multiple: true, // tokenSeparators: [','] // }); }); // document ready end // error and success div timouts setTimeout(() => { $('.error_div').fadeOut('slow'); $('.success_div').fadeOut('slow'); }, 3000); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('master.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/makmfewe/dingomo.com/resources/views/blog/edit.blade.php ENDPATH**/ ?>