<?php $__env->startSection('page_title',__('Edit '). ' '.__(kebab2Title($content->name))); ?>

<?php $__env->startPush('extra_styles'); ?>
	<link href="<?php echo e(asset('assets/dashboard/css/jquery-ui.min.css')); ?>" rel="stylesheet" type="text/css">
	<link href="<?php echo e(asset('assets/dashboard/css/bootstrap-iconpicker.min.css')); ?>" rel="stylesheet" type="text/css">
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
<div class="main-content">
	<section class="section">
		<div class="section-header">
			<h1><?php echo app('translator')->get('Edit'); ?> <?php echo app('translator')->get(kebab2Title($content->name)); ?></h1>
			<div class="section-header-breadcrumb">
				<div class="breadcrumb-item active">
					<a href="<?php echo e(route('admin.home')); ?>"><?php echo app('translator')->get('Dashboard'); ?></a>
				</div>
				<div class="breadcrumb-item"><?php echo app('translator')->get('Edit'); ?> <?php echo app('translator')->get(kebab2Title($content->name)); ?></div>
			</div>
		</div>

		<div class="row mb-3">
			<div class="container-fluid" id="container-wrapper">
				<div class="row justify-content-md-center">
					<div class="col-lg-12">
						<div class="card mb-4 card-primary shadow">
							<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
								<h6 class="m-0 font-weight-bold text-primary"><?php echo app('translator')->get('Edit'); ?> <?php echo app('translator')->get(kebab2Title($content->name)); ?></h6>
								<a href="<?php echo e(url()->previous()); ?>" class="btn btn-sm btn-outline-primary"> <i class="fas fa-arrow-left"></i> <?php echo app('translator')->get('Back'); ?></a>
							</div>
							<div class="card-body">
								<?php if(array_key_exists('language',config("contents.$content->name")) && config("contents.$content.language") == 0): ?>
									<form method="post" action="<?php echo e(route('content.update', [$content,0])); ?>" enctype="multipart/form-data">
										<?php echo csrf_field(); ?>
										<?php echo method_field('put'); ?>
										<div class="row">
											<?php $__currentLoopData = config("contents.$content->name.field_name"); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name => $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
												<?php if($type == 'file'): ?>
													<div class="col-md-6">
														<div class="form-group mb-4">
															<label class="col-form-label"><?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?></label>
															<div id="image-preview" class="image-preview" style="background-image: url(<?php echo e(getFile(config('location.content.path').(isset($contentMedia->description->{$name}) ? @$contentMedia->description->{$name} : ''))); ?>);">
															<label for="image-upload" id="image-label"><?php echo app('translator')->get('Choose File'); ?></label>
															<input type="file" name="<?php echo e($name); ?>[0]" class="<?php $__errorArgs = [$name.'.0'];
$__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); ?>" id="image-upload"/>
															</div>
															<div class="invalid-feedback">
																<?php $__errorArgs = [$name.'.0'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
															</div>
														</div>
													</div>
												<?php elseif($type == 'url'): ?>
													<div class="col-md-12">
														<div class="form-group">
															<label for="<?php echo e($name); ?>"> <?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?> </label>
															<input type="<?php echo e($type); ?>" name="<?php echo e($name); ?>[0]"
																   class="form-control <?php $__errorArgs = [$name.'.0'];
$__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); ?>"
																   value="<?php echo e(old($name.'.0', isset($contentMedia->description->{$name}) ? @$contentMedia->description->{$name} : '')); ?>">
															<div class="invalid-feedback">
																<?php $__errorArgs = [$name.'.0'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
															</div>
															<div class="valid-feedback"></div>
														</div>
													</div>
												<?php elseif($type == 'icon'): ?>
													<div class="col-md-12">
														<div class="form-group">
															<label for="<?php echo e($name); ?>"> <?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?> </label>
															<div class="input-group input-group-sm">
																<input type="text" name="<?php echo e($name); ?>[<?php echo e(0); ?>]"
																	   class="form-control icon <?php $__errorArgs = [$name.'.0'];
$__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); ?>"
																	   value="<?php echo e(old($name.'.0', isset($contentMedia->description->{$name}) ? @$contentMedia->description->{$name} : '')); ?>">
																<div class="input-group-append">
																	<button class="btn btn-outline-primary iconPicker"
																			data-icon="<?php echo e(old($name.'.0', isset($contentMedia->description->{$name}) ? @$contentMedia->description->{$name} : '')); ?>"
																			role="iconpicker"></button>
																</div>
																<div class="invalid-feedback"><?php $__errorArgs = [$name.'.0'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?></div>
															</div>
														</div>
													</div>
												<?php endif; ?>
											<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
										</div>
										<button type="submit" class="btn btn-primary btn-sm btn-block"><?php echo app('translator')->get('Save Change'); ?></button>
									</form>
								<?php else: ?>
									<ul class="nav nav-tabs" id="myTab" role="tablist">
										<?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<li class="nav-item">
												<a class="nav-link <?php echo e($loop->first ? 'active' : ''); ?>" data-toggle="tab" href="#lang-tab-<?php echo e($key); ?>" role="tab" aria-controls="lang-tab-<?php echo e($key); ?>"
												   aria-selected="<?php echo e($loop->first ? 'true' : 'false'); ?>"><?php echo app('translator')->get($language->name); ?></a>
											</li>
										<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
									</ul>
									<div class="tab-content mt-2" id="myTabContent">
										<?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<div class="tab-pane fade <?php echo e($loop->first ? 'show active' : ''); ?>" id="lang-tab-<?php echo e($key); ?>" role="tabpanel">
												<form method="post" action="<?php echo e(route('content.update', [$content,$language->id])); ?>" enctype="multipart/form-data">
													<?php echo csrf_field(); ?>
													<?php echo method_field('put'); ?>
													<div class="row">
														<?php $__currentLoopData = config("contents.$content->name.field_name"); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $name => $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
															<?php if($type == 'text'): ?>
																<div class="col-md-12">
																	<div class="form-group">
																		<label for="<?php echo e($name); ?>"> <?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?> </label>
																		<input type="<?php echo e($type); ?>" name="<?php echo e($name); ?>[<?php echo e($language->id); ?>]"
																			   class="form-control <?php $__errorArgs = [$name.'.'.$language->id];
$__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); ?>"
																			   value="<?php echo e(old($name.'.'.$language->id, isset($contentDetails[$language->id]) ? @$contentDetails[$language->id][0]->description->{$name} : '')); ?>">
																		<div class="invalid-feedback">
																			<?php $__errorArgs = [$name.'.'.$language->id];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
																		</div>
																		<div class="valid-feedback"></div>
																	</div>
																</div>
															<?php elseif($type == 'file' && $key == 0): ?>
																<div class="col-md-6">
																	<div class="form-group mb-4">
																		<label class="col-form-label"><?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?></label>
																		<div id="image-preview" class="image-preview" style="background-image: url(<?php echo e(getFile(config('location.content.path').(isset($contentMedia->description->{$name}) ? @$contentMedia->description->{$name} : ''))); ?>);">
																		<label for="image-upload" id="image-label"><?php echo app('translator')->get('Choose File'); ?></label>
																		<input type="file" name="<?php echo e($name); ?>[<?php echo e($language->id); ?>]" class="<?php $__errorArgs = [$name.'.'.$language->id];
$__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); ?>" id="image-upload"/>
																		</div>
																		<div class="invalid-feedback">
																			<?php $__errorArgs = [$name.'.'.$language->id];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
																		</div>
																	</div>
																</div>
															<?php elseif($type == 'url' && $key == 0): ?>
																<div class="col-md-12">
																	<div class="form-group">
																		<label for="<?php echo e($name); ?>"> <?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?> </label>
																		<input type="<?php echo e($type); ?>" name="<?php echo e($name); ?>[<?php echo e($language->id); ?>]"
																			   class="form-control <?php $__errorArgs = [$name.'.'.$language->id];
$__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); ?>"
																			   value="<?php echo e(old($name.'.'.$language->id, isset($contentMedia->description->{$name}) ? @$contentMedia->description->{$name} : '')); ?>">
																		<div class="invalid-feedback">
																			<?php $__errorArgs = [$name.'.'.$language->id];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
																		</div>
																		<div class="valid-feedback"></div>
																	</div>
																</div>
															<?php elseif($type == 'textarea'): ?>
																<div class="col-md-12">
																	<div class="form-group">
																		<label for="<?php echo e($name); ?>"><?php echo app('translator')->get(ucwords(str_replace('_',' ',$name))); ?></label>
																		<textarea class="form-control summernote <?php $__errorArgs = [$name.'.'.$language->id];
$__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="<?php echo e($name); ?>[<?php echo e($language->id); ?>]"
																				  rows="5"><?php echo e(old($name.'.'.$language->id, isset($contentDetails[$language->id]) ? @$contentDetails[$language->id][0]->description->{$name} : '')); ?></textarea>
																		<div class="invalid-feedback">
																			<?php $__errorArgs = [$name.'.'.$language->id];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo app('translator')->get($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
																		</div>
																	</div>
																</div>
															<?php endif; ?>
														<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
													</div>
													<button type="submit" class="btn btn-primary btn-sm btn-block"><?php echo app('translator')->get('Save Change'); ?></button>
												</form>
											</div>
										<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
									</div>
								<?php endif; ?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</section>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('extra_scripts'); ?>
	<script src="<?php echo e(asset('assets/dashboard/js/bootstrap-iconpicker.bundle.min.js')); ?>"></script>
	<script src="<?php echo e(asset('assets/dashboard/js/jquery.uploadPreview.min.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('scripts'); ?>
	<script>
		'use strict'
		$(document).ready(function () {
			$('.iconPicker').iconpicker({
				align: 'center', // Only in div tag
				arrowClass: 'btn-danger',
				arrowPrevIconClass: 'fas fa-angle-left',
				arrowNextIconClass: 'fas fa-angle-right',
				cols: 10,
				footer: true,
				header: true,
				icon: 'fas fa-bomb',
				iconset: 'fontawesome5',
				labelHeader: '{0} of {1} pages',
				labelFooter: '{0} - {1} of {2} icons',
				placement: 'bottom', // Only in button tag
				rows: 5,
				search: true,
				searchText: 'Search icon',
				selectedClass: 'btn-success',
				unselectedClass: ''
			}).on('change', function (e) {
				$(this).parent().siblings('.icon').val(`${e.icon}`);
			});

			$.uploadPreview({
				input_field: "#image-upload",
				preview_box: "#image-preview",
				label_field: "#image-label",
				label_default: "Choose File",
				label_selected: "Change File",
				no_label: false
			});
		});
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\xamp\htdocs\Paysecure-wallet\project\resources\views/admin/content/show.blade.php ENDPATH**/ ?>