252 lines
11 KiB
PHP
252 lines
11 KiB
PHP
<div class="row">
|
|
<div class="col-lg-9">
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="row gy-3">
|
|
<div class="col-md-6">
|
|
<?php echo e(html()->label('Title')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->span('*')->class('text-danger')); ?>
|
|
|
|
<?php echo e(html()->text('title')->class('form-control')->placeholder('Menu Title')->required()); ?>
|
|
|
|
<?php echo e(html()->div('Menu title is required')->class('invalid-feedback')); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<?php echo e(html()->label('Location')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->span('*')->class('text-danger')); ?>
|
|
|
|
<?php echo e(html()->select('menu_location_id', config('constants.menu_location_options'))->class('form-select choices-select ')->required(true)); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<?php echo e(html()->label('Type')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->span('*')->class('text-danger')); ?>
|
|
|
|
<?php echo e(html()->select('type', $menuTypes)->id('menuType')->class('form-select choices-select')->required(true)); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<?php echo e(html()->label('Sub menu of (Empty if Parent Menu)')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->select('parent_id', $menuOptions)->class('form-select choices-select')->placeholder('Select Parent')); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6 dropdown-row" style="display: none">
|
|
<?php echo e(html()->label('Ref (select Reference)')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->span('*')->class('text-danger')); ?>
|
|
|
|
<?php echo e(html()->select('parameter', [])->id('parameterDropdown')->class('form-select')->placeholder('Select option')); ?>
|
|
|
|
<?php echo e(html()->div('Reference is required')->class('invalid-feedback')); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6 text-row">
|
|
<?php echo e(html()->label('#(Fragment) or Start from /(Custom)')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->span('*')->class('text-danger')); ?>
|
|
|
|
<?php echo e(html()->text('parameter')->id('parameterInput')->class('form-control')); ?>
|
|
|
|
<?php echo e(html()->div('Link is required')->class('invalid-feedback')); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="card-title mb-0">Icon</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<?php echo e(html()->label('Image')->class('form-label mb-1')->for('image')); ?>
|
|
|
|
<?php if (isset($component)) { $__componentOriginal4a95833b519aeb799c35637497d32ce2 = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginal4a95833b519aeb799c35637497d32ce2 = $attributes; } ?>
|
|
<?php $component = App\View\Components\ImageInput::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('image-input'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\App\View\Components\ImageInput::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes(['data' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($editable ? $menu->getRawOriginal('image') : null),'id' => 'image','name' => 'image','editable' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($editable),'multiple' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(false)]); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginal4a95833b519aeb799c35637497d32ce2)): ?>
|
|
<?php $attributes = $__attributesOriginal4a95833b519aeb799c35637497d32ce2; ?>
|
|
<?php unset($__attributesOriginal4a95833b519aeb799c35637497d32ce2); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginal4a95833b519aeb799c35637497d32ce2)): ?>
|
|
<?php $component = $__componentOriginal4a95833b519aeb799c35637497d32ce2; ?>
|
|
<?php unset($__componentOriginal4a95833b519aeb799c35637497d32ce2); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<?php echo e(html()->label('Icon (Optional)')->class('form-label')); ?>
|
|
|
|
<?php echo e(html()->text('icon')->class('form-control')->placeholder('Icon class')); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end card body -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- end col -->
|
|
<div class="col-lg-3">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="card-title mb-0">Publish</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<?php echo e(html()->select('status', config('constants.page_status_options'))->class('form-select choices-select ')); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end card body -->
|
|
<?php if (isset($component)) { $__componentOriginal4472fe0a558b38a919fed94c8472a9fd = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginal4472fe0a558b38a919fed94c8472a9fd = $attributes; } ?>
|
|
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.form-buttons','data' => ['editable' => $editable,'label' => 'Create','href' => ''.e(route('menu.index')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('form-buttons'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes(['editable' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($editable),'label' => 'Create','href' => ''.e(route('menu.index')).'']); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginal4472fe0a558b38a919fed94c8472a9fd)): ?>
|
|
<?php $attributes = $__attributesOriginal4472fe0a558b38a919fed94c8472a9fd; ?>
|
|
<?php unset($__attributesOriginal4472fe0a558b38a919fed94c8472a9fd); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginal4472fe0a558b38a919fed94c8472a9fd)): ?>
|
|
<?php $component = $__componentOriginal4472fe0a558b38a919fed94c8472a9fd; ?>
|
|
<?php unset($__componentOriginal4472fe0a558b38a919fed94c8472a9fd); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="card featured-image-section">
|
|
<div class="card-header">
|
|
<h6 class="card-title mb-0 fs-14">
|
|
Target
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="mb-3">
|
|
<?php echo e(html()->select('target', config('constants.redirect_options'))->class('form-select choices-select')); ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end col -->
|
|
</div>
|
|
|
|
<?php $__env->startPush('js'); ?>
|
|
<script src="<?php echo e(asset('assets/js/pages/form-validation.init.js')); ?>"></script>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
const editable = '<?php echo e($editable); ?>';
|
|
console.log(editable);
|
|
|
|
if (editable == 1) {
|
|
const selectedValue = "<?php echo e($menu->parameter ?? null); ?>";
|
|
$('#menuType').trigger('change', [selectedValue]);
|
|
}
|
|
});
|
|
|
|
$(document).on('change', '#menuType', function(event, selectedValue) {
|
|
|
|
const value = $(this).val();
|
|
|
|
if (value == 'single-link' || value == 'fragment') {
|
|
|
|
$('.dropdown-row').hide();
|
|
|
|
$('#parameterDropdown').prop({
|
|
required: false,
|
|
});
|
|
|
|
$('.text-row').show();
|
|
|
|
$('#parameterInput').prop({
|
|
required: true,
|
|
disabled: false
|
|
});
|
|
|
|
} else {
|
|
|
|
$('.dropdown-row').show();
|
|
|
|
$('#parameterDropdown').prop({
|
|
required: true,
|
|
});
|
|
|
|
$('.text-row').hide();
|
|
|
|
$('#parameterInput').prop({
|
|
required: false,
|
|
disabled: true
|
|
});
|
|
|
|
$.ajax({
|
|
url: '<?php echo e(route('menu.getMenuTypeOptions')); ?>',
|
|
type: 'GET',
|
|
data: {
|
|
tableName: value,
|
|
},
|
|
dataType: 'json',
|
|
})
|
|
.done(function(response) {
|
|
$('#parameterDropdown').empty();
|
|
|
|
$('#parameterDropdown').append($('<option>', {
|
|
value: null,
|
|
text: 'Select option',
|
|
selected: true,
|
|
disabled: true
|
|
}));
|
|
|
|
console.log(response.data);
|
|
|
|
$.each(response.data, function(value, text) {
|
|
const option = $('<option>', {
|
|
value: value,
|
|
text: text
|
|
});
|
|
if (value === selectedValue) {
|
|
option.prop('selected', true);
|
|
}
|
|
$('#parameterDropdown').append(option);
|
|
});
|
|
})
|
|
.fail(function(jqXHR, textStatus, errorThrown) {
|
|
console.error("AJAX request failed: ", textStatus, errorThrown);
|
|
});
|
|
}
|
|
});
|
|
</script>
|
|
<?php $__env->stopPush(); ?>
|
|
<?php /**PATH /home/rohiniedu/public_html/Modules/Menu/resources/views/menu/partials/_form.blade.php ENDPATH**/ ?>
|