

<?php $__env->startSection('title'); ?>
	<?php if($page == "section1"): ?>
  	<?php echo e(ucwords($page_section1)); ?>

  <?php else: ?>
  	<?php echo e(ucwords($page_section2)); ?>

  <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

  <!-- MAIN CONTENT -->
  <div class="container-fluid">

		
		<div class="row">
    		<div class="col-xs-12">
				<section id="message-banner" class="panel panel-primary">
					<header class="panel-heading">
						<h2>
							<?php echo app('translator')->getFromJson('backend.banner-header'); ?>
						</h2>
					</header>
					<?php echo Form::open(['url'=>route('sectionSaveBanner'),'method'=>'post','files'=>true, 'class' => 'image-form']); ?>

					<?php echo Form::hidden('section_name',$page); ?>

					<?php echo Form::hidden('id',isset($banner->id)?$banner->id:""); ?>

					<?php echo Form::hidden('image'); ?>


					<div class="panel-body">
						<?php if(Session::has('message-banner')): ?>
							<div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
								<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
							 	<p><?php echo e(Session::get('message-banner')); ?></p>
							</div>
						<?php endif; ?>

						
            <div class="" style="width: 800px; margin: 0 auto 20px auto;">
              <div class="image-cropper" data-height="160" data-width="800" data-exportZoom="2"
              	data-src="<?php echo e(asset($storage_url.'img/sections/'.$banner->media_url)); ?>">
                <div class="cropit-preview">
                  <div class="caption">
                    <p><?php echo app('translator')->getFromJson('backend.minimum-resolution'); ?> 1600x320 px</p>
                  </div>
                </div>

                <div class="controls-wrapper">
                  <div class="rotation-btns">
                    <a class="rotate-ccw-btn"><i class="fa fa-undo"></i></a>
                    <a class="rotate-cw-btn"><i class="fa fa-repeat"></i></a>
                  </div>
                  <div class="slider-wrapper">
                    <i class="fa fa-picture-o" aria-hidden="true"></i>
                    <input type="range" class="cropit-image-zoom-input">
                    <i class="fa fa-picture-o fa-2x" aria-hidden="true"></i>
                  </div>
                </div>

                <label for="cropit-image-input" class="btn btn-primary btn-outlined"><?php echo app('translator')->getFromJson('backend.upload'); ?></label>
                <input type="file" class="cropit-image-input" style="display:none"/>

                <button title="<?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?>" type="button" class="btn btn-primary btn-outlined js-pixabay-trigger"><?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?></button>
              </div>
            </div>
            

						<div class="form-group image-with-preview col-xs-12">
							<div class="row">
								<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
									<?php 
										if( count(config('translatable.locales')) > 1 ){
											$lang_ext = $language;
											$col = "col-sm-6";
										}else{
											$lang_ext = "";
											$col = "";
										}
										if(isset($banner)){
											$get = $banner->locales()->where('locale',$lang)->first();
										}else{
											$get ="";
										}

										if(empty($get)){
											$banner_caption = isset($banner)?$banner->media_title:"";
											$alt = isset($banner)?$banner->media_desc:"";
										}else{
											$banner_caption = $get->media_title;
											$alt = $get->media_desc;
										}
									 ?>
									<div class="col-xs-12 <?php echo e($col); ?>">
										<div class="panel panel-info">
										<div class="panel-heading">
											<h3><?php echo e($lang_ext); ?></h3>
										</div>
										<div class="panel-body">
											<div class="form-group">
												<?php echo Form::label('banner_caption',__('backend.caption'),['class'=>'control-label']); ?>

												<div class="<?php echo e($errors->has('banner_caption') ? ' has-error' : ''); ?>">
													<?php echo Form::text('banner_caption['.$lang.']', $banner_caption,['class'=>'form-control']); ?>

													<?php if($errors->has('banner_section')): ?>
					                    <span class="help-block">
					                        <strong><?php echo e($errors->first('banner_caption')); ?></strong>
					                    </span>
					                <?php endif; ?>
												</div>
											</div>
											<div class="form-group">
                        <?php echo Form::label('imagealt',__('backend.seo'),['class'=>'control-label']); ?>

                        <div class="<?php echo e($errors->has('imagealt') ? ' has-error' : ''); ?>">
                          <?php echo Form::text('imagealt['.$lang.']',$alt,['class'=>'form-control']); ?>

                          <?php if($errors->has('imagealt')): ?>
                              <span class="help-block">
                                  <strong><?php echo e($errors->first('imagealt')); ?></strong>
                              </span>
                          <?php endif; ?>
                        </div>
                      </div>
										</div>
									</div>
									</div>
								<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							</div>
						</div>

					</div>
					<footer class="panel-footer text-center">
						<button type="submit" class="btn btn-primary btn-image-submit"><?php echo app('translator')->getFromJson('backend.update'); ?></button>
					</footer>
					<?php echo Form::close(); ?>

				</section>
    		</div>
    	</div>
	    
    	<div class="row">
    		<div class="col-xs-12">
				<section id="message-content" class="panel panel-primary">
					<header class="panel-heading">
						<h2>
							<?php echo app('translator')->getFromJson('backend.content'); ?>
							<button class="btn btn-success" data-toggle="modal" data-target="#addContent"><?php echo app('translator')->getFromJson('backend.add-content'); ?></button>
							<button class="btn btn-warning" data-toggle="modal" data-target="#reorder"><?php echo app('translator')->getFromJson('backend.arrange-order'); ?></button>
						</h2>
					</header>
					<div class="panel-body">
						<?php if(Session::has('message-content')): ?>
							<div class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
								<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
							 	<p><?php echo e(Session::get('message-content')); ?></p>
							</div>
						<?php endif; ?>
						<?php if($errors->any()): ?>
							<div id="message-content" class="alert alert-danger alert-dismissible" role="alert">
								<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
								<ul>
								 	<?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
								        <li><?php echo e($error); ?></li>
								    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							    </ul>
							</div>
						<?php endif; ?>
						<div class="table-responsive">
				    		<table id="contentsTable" class="table table-hover">
							    <thead>
								    <tr>
								    	<th class="text-center">#</th>
								        <th class="text-center"><?php echo app('translator')->getFromJson('backend.image'); ?></th>
												<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
													<?php if(count(config('translatable.locales'))>1): ?>
														<th class="text-center"><?php echo app('translator')->getFromJson('backend.title'); ?> [<?php echo e($language); ?>]</th>
													<?php else: ?>
														<th class="text-center"><?php echo app('translator')->getFromJson('backend.title'); ?></th>
													<?php endif; ?>
												<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

												<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
													<?php if(count(config('translatable.locales'))>1): ?>
														<th class="text-center" width="20%"><?php echo app('translator')->getFromJson('backend.content'); ?> [<?php echo e($language); ?>]</th>
													<?php else: ?>
														<th class="text-center" width="20%"><?php echo app('translator')->getFromJson('backend.content'); ?></th>
													<?php endif; ?>
												<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								        <th class="text-center"><?php echo app('translator')->getFromJson('backend.options'); ?></th>
								    </tr>
							    </thead>
							    <tbody>
								    <?php $__currentLoopData = $contents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
									    <tr>
									    	<td class="text-center"><?php echo e($key+1); ?></td>
									        <td class="text-center">

														<?php if($val->media_type=="image"): ?>
										        	<img class="img-responsive" alt="image" src="<?php echo e(asset($storage_url.'img/sections/'.$val->media_url)); ?>" style="width:200px; height:auto;">
														<?php elseif($val->media_type=="video"): ?>
															<div class="mediaWrapper">
																<iframe src="<?php echo e($val->media_url); ?>" frameborder="0" allowfullscreen>
																</iframe>
   														</div>
 														<?php else: ?>
 															<?php if(isset($val->album) && $val->album->count()): ?>
 																<?php 
 																	$album = $val->album;
 																	$gallery = $album->galleries()->first();
 																 ?>
 																<img class="img-responsive" src="<?php echo e(asset($storage_url.'img/gallery/'.$album->slug.'/'.str_replace('.', '_tn.', $gallery->path))); ?>" alt="" style="width:200px; height:auto;">
 															<?php endif; ?>
														<?php endif; ?>

									        </td>
													<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
														<?php 
															$get = $val->locales()->where('locale',$lang)->first();
														 ?>
										        <td>
										        	<?php echo e(isset($get->media_title) ? $get->media_title : $val->media_title); ?>

										        </td>
													<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
													<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
														<?php 
															$get = $val->locales()->where('locale',$lang)->first();
														 ?>
										        <td>
										        	<?php echo str_limit(strip_tags(isset($get)?$get->media_content:$val->media_content), (200 / count(config('translatable.locales')))); ?>

										        </td>
													<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
									        <td class="text-center">
												
												<button title="Update content" class="btn btn-warning" data-toggle="modal" data-target="#update<?php echo e($val->id); ?>"><i class="fa fa-pencil" aria-hidden="true"></i></button>

									        	
												<button title="Delete content" class="btn btn-danger" data-toggle="modal" data-target="#delete<?php echo e($val->id); ?>"><i class="fa fa-trash" aria-hidden="true"></i></button>
												<div id="delete<?php echo e($val->id); ?>" class="modal fade" role="dialog">
													<div class="modal-dialog modal-sm">

													<?php echo Form::open(['url' => route('sectionDeleteContent',['id'=>$val->id]),'method'=>'delete']); ?>

														<?php echo Form::hidden('id',$val->id); ?>

														<div class="modal-content text-center">
															<div class="modal-body">
																<h3><?php echo app('translator')->getFromJson('backend.ask-delete-content'); ?></h3>
																<button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.delete'); ?></button>
																<button class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->getFromJson('backend.cancel'); ?></button>
															</div>
														</div>
													<?php echo Form::close(); ?>


													</div>
												</div>
									        </td>
									    </tr>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
							    </tbody>
							</table>
				    	</div>
					</div>

					<?php $__currentLoopData = $contents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
						<div id="update<?php echo e($val->id); ?>" class="modal fade" role="dialog">
							<div class="modal-dialog modal-lg">

							<?php echo Form::open(['url' => route('sectionUpdateContent',['id'=>$val->id]),'method'=>'post','files'=>true, 'class' => 'image-form']); ?>

							<?php echo Form::hidden('id',$val->id); ?>

							<?php echo Form::hidden('section',$page); ?>

							<?php echo Form::hidden('image'); ?>

							<div class="modal-content text-center">
								<div class="modal-body container-fluid">
									<div class="col-xs-12">
										<label for=""><?php echo app('translator')->getFromJson('backend.media-type'); ?> : </label>
									</div>

									<div class="col-xs-12">
										<div class="form-group">
											<label class="radio-inline">
			                	<input type="radio" name="media_type" value="image" <?php echo e($val->media_type=="image" ? 'checked' : ''); ?>><?php echo app('translator')->getFromJson('backend.image'); ?>
			                </label>
											<label class="radio-inline">
			                	<input type="radio" name="media_type" value="video" <?php echo e($val->media_type=="video" ? 'checked' : ''); ?>><?php echo app('translator')->getFromJson('backend.video'); ?>
			                </label>
			                <label class="radio-inline">
			                	<input type="radio" name="media_type" value="gallery" <?php echo e($val->media_type=="gallery" ? 'checked' : ''); ?>><?php echo app('translator')->getFromJson('backend.gallery'); ?>
			                </label>
				            </div>
					        </div>

									<div class="col-xs-12">

										
										<div class="image-upload-wrapper" style="display: <?php echo e($val->media_type!='image' ? 'none' : ''); ?>">
											<div class="" style="width: 800px; margin: 0 auto 20px auto;">
					              <div class="image-cropper" data-height="600" data-width="800" data-exportZoom="1"
					              	data-src="<?php echo e($val->media_type=='image' ? asset($storage_url.'img/sections/'.$val->media_url) : ''); ?>">
					                <div class="cropit-preview">
					                  <div class="caption">
					                    <p><?php echo app('translator')->getFromJson('backend.minimum-resolution'); ?> 800x600 px</p>
					                  </div>
					                </div>

					                <div class="controls-wrapper">
					                  <div class="rotation-btns">
					                    <a class="rotate-ccw-btn"><i class="fa fa-undo"></i></a>
					                    <a class="rotate-cw-btn"><i class="fa fa-repeat"></i></a>
					                  </div>
					                  <div class="slider-wrapper">
					                    <i class="fa fa-picture-o" aria-hidden="true"></i>
					                    <input type="range" class="cropit-image-zoom-input">
					                    <i class="fa fa-picture-o fa-2x" aria-hidden="true"></i>
					                  </div>
					                </div>

					                <label for="cropit-image-input" class="btn btn-primary btn-outlined"><?php echo app('translator')->getFromJson('backend.upload'); ?></label>
				                  <input type="file" class="cropit-image-input" style="display:none"/>

				                  <button title="<?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?>" type="button" class="btn btn-primary btn-outlined js-pixabay-trigger"><?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?></button>
					              </div>
					            </div>
				            </div>
										

										
										<div class="video-upload-wrapper" style="display: <?php echo e($val->media_type!='video' ? 'none' : ''); ?>">
											<div class="form-group">
												<label for="media_link" class="control-label"><?php echo app('translator')->getFromJson('backend.youtube-video-url'); ?></label>
												<input type="url" name="media_link" class="form-control m-b-5"
													placeholder="https://www.youtube.com/watch/example">
												<label for="media_url" class="control-label"><?php echo app('translator')->getFromJson('backend.generated-embed-link'); ?></label>
												<input type="url" name="media_url" class="form-control"
													placeholder="https://www.youtube.com/embed/example"
													value="<?php echo e($val->media_type=='video' ? $val->media_url : ''); ?>" readonly>
											</div>
										</div>
										

										
										<div class="gallery-upload-wrapper" style="display: <?php echo e($val->media_type!='gallery' ? 'none' : ''); ?>">
											<div class="form-group">
												<label for="album" class="control-label"><?php echo app('translator')->getFromJson('backend.select-album'); ?></label>
												<select name="album" class="selectpicker">
													<?php $__currentLoopData = $albums; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $album): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
														<option value="<?php echo e($album->id); ?>" <?php if($album->id==$val->media_url): ?> selected <?php endif; ?>><?php echo e($album->name); ?></option>
													<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
												</select>
											</div>
										</div>
										

									</div>
									<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
										<?php 
											if(count(config('translatable.locales'))>1){
												$lang_ext = $language;
											}else{
												$lang_ext = "";
											}

											$get = $val->locales()->where('locale',$lang)->first();
											if(empty($get)){
												$title = $val->media_title;
												$text = $val->media_content;
												$alt = $val->media_desc;
											}else{
												$title = $get->media_title;
												$text = $get->media_content;
												$alt = $get->media_desc;
											}
										 ?>
										<div class="col-xs-12">
											<div class="panel panel-info">
												<div class="panel-heading">
													<h3><?php echo e($lang_ext); ?></h3>
												</div>
												<div class="panel-body">
													<div class="form-group">
		                        <?php echo Form::label('imagealt',__('backend.seo'),['class'=>'control-label']); ?>

		                        <div class="<?php echo e($errors->has('imagealt') ? ' has-error' : ''); ?>">
		                          <?php echo Form::text('imagealt['.$lang.']',$alt,['class'=>'form-control']); ?>

		                        </div>
		                      </div>
													<div class="form-group">
														<?php echo Form::label('title_content',__('backend.title'),['class'=>'control-label']); ?>

														<div class="">
															<?php echo Form::text('title_content['.$lang.']',$title,['class'=>'form-control']); ?>

														</div>
													</div>
													<div class="form-group">
														<?php echo Form::label('text_content',__('backend.text-content'),['class'=>'control-label']); ?>

														<div class="">
															<?php echo Form::textarea('text_content['.$lang.']',$text,['class'=>'form-control']); ?>

														</div>
													</div>
												</div>
											</div>
										</div>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

								</div>
								<div class="modal-footer">
									<button type="submit" class="btn btn-primary btn-image-submit"><?php echo app('translator')->getFromJson('backend.save'); ?></button>
									<button class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->getFromJson('backend.cancel'); ?></button>
								</div>
							</div>
							<?php echo Form::close(); ?>


							</div>
						</div>
					<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

					<div id="addContent" class="modal fade" role="dialog">
						<div class="modal-dialog modal-lg">
							<div class="modal-content">
								<div class="modal-header">
									<h2><?php echo app('translator')->getFromJson('backend.add-content'); ?></h2>
								</div>

								<?php echo Form::open(['url' => route('sectionSaveContent'),'method' => 'post','files'=>true, 'class' => 'image-form']); ?>

								<?php echo Form::hidden('section',$page); ?>

								<?php echo Form::hidden('image'); ?>

								<div class="modal-body container-fluid text-center">

									<?php if(Session::has('message-addcontent')): ?>
										<div id="message-addcontent" class="alert <?php echo e(Session::get('alert-class')); ?> alert-dismissible" role="alert">
											<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
										 	<p><?php echo e(Session::get('message-addcontent')); ?></p>
										</div>
									<?php endif; ?>

									<div class="col-xs-12">
										<label for=""><?php echo app('translator')->getFromJson('backend.media-type'); ?> : </label>
									</div>

									<div class="col-xs-12">
										<div class="form-group">
											<label class="radio-inline">
			                	<input type="radio" name="media_type" value="image" checked><?php echo app('translator')->getFromJson('backend.image'); ?>
			                </label>
											<label class="radio-inline">
			                	<input type="radio" name="media_type" value="video"><?php echo app('translator')->getFromJson('backend.video'); ?>
			                </label>
											<label class="radio-inline">
			                	<input type="radio" name="media_type" value="gallery"><?php echo app('translator')->getFromJson('backend.gallery'); ?>
			                </label>
				            </div>
					        </div>

									<div class="col-xs-12">

										
										<div class="image-upload-wrapper">
					            <div class="" style="width: 800px; margin: 0 auto 20px auto;">
					              <div class="image-cropper" data-height="600" data-width="800" data-exportZoom="1">
					                <div class="cropit-preview">
					                  <div class="caption">
					                    <p><?php echo app('translator')->getFromJson('backend.minimum-resolution'); ?> 800x600 px</p>
					                  </div>
					                </div>

					                <div class="controls-wrapper">
					                  <div class="rotation-btns">
					                    <a class="rotate-ccw-btn"><i class="fa fa-undo"></i></a>
					                    <a class="rotate-cw-btn"><i class="fa fa-repeat"></i></a>
					                  </div>
					                  <div class="slider-wrapper">
					                    <i class="fa fa-picture-o" aria-hidden="true"></i>
					                    <input type="range" class="cropit-image-zoom-input">
					                    <i class="fa fa-picture-o fa-2x" aria-hidden="true"></i>
					                  </div>
					                </div>

					                <label for="cropit-image-input" class="btn btn-primary btn-outlined"><?php echo app('translator')->getFromJson('backend.upload'); ?></label>
				                  <input type="file" class="cropit-image-input" style="display:none"/>

				                  <button title="<?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?>" type="button" class="btn btn-primary btn-outlined js-pixabay-trigger"><?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?></button>
					              </div>
					            </div>
										</div>
										

										
										<div class="video-upload-wrapper" style="display: none">
											<div class="form-group">
												<label for="media_link" class="control-label"><?php echo app('translator')->getFromJson('backend.youtube-video-url'); ?></label>
												<input type="url" name="media_link" class="form-control m-b-5"
													placeholder="https://www.youtube.com/watch/example">
												<label for="media_url" class="control-label"><?php echo app('translator')->getFromJson('backend.generated-embed-link'); ?></label>
												<input type="url" name="media_url" class="form-control"
													placeholder="https://www.youtube.com/embed/example"
													value="" readonly>
											</div>
										</div>
										

										
										<div class="gallery-upload-wrapper" style="display: none">
											<div class="form-group">
												<label for="album" class="control-label"><?php echo app('translator')->getFromJson('backend.select-album'); ?></label>
												<select name="album" class="selectpicker">
													<?php $__currentLoopData = $albums; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $album): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
														<option value="<?php echo e($album->id); ?>"><?php echo e($album->name); ?></option>
													<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
												</select>
											</div>
										</div>
										

									</div>
									<?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
										<?php 
											if(count(config('translatable.locales'))>1){
												$lang_ext = $language;
											}else{
												$lang_ext = "";
											}
										 ?>
										<div class="col-xs-12">
											<div class="panel panel-info">
												<div class="panel-heading">
													<h3><?php echo e($lang_ext); ?></h3>
												</div>
												<div class="panel-body">
													<div class="form-group">
		                        <?php echo Form::label('imagealt',__('backend.seo'),['class'=>'control-label']); ?>

		                        <div class="">
		                          <?php echo Form::text('imagealt['.$lang.']','',['class'=>'form-control']); ?>

		                        </div>
		                      </div>
													<div class="form-group">
														<?php echo Form::label('title_content',__('backend.title'),['class'=>'control-label']); ?>

														<div class="">
															<?php echo Form::text('title_content['.$lang.']','',['class'=>'form-control']); ?>

														</div>
													</div>
													<div class="form-group">
														<?php echo Form::label('text_content',__('backend.text-content'),['class'=>'control-label']); ?>

														<div class="">
															<?php echo Form::textarea('text_content['.$lang.']','',['class'=>'form-control']); ?>

														</div>
													</div>
												</div>
											</div>
										</div>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								</div>
								<div class="modal-footer">
									<button type="submit" class="btn btn-primary btn-image-submit"><?php echo app('translator')->getFromJson('backend.save'); ?></button>
									<button class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->getFromJson('backend.cancel'); ?></button>
								</div>
								<?php echo Form::close(); ?>

							</div>
						</div>
					</div>
				</section>

				
        <div id="reorder" class="modal fade" role="dialog">
	        <div class="modal-dialog">

	        <?php echo Form::open(['url' => route('beSectionOrder'),'method'=>'post']); ?>

	          <div class="modal-content">
	            <div class="modal-header">
	              <h2><?php echo app('translator')->getFromJson('backend.rearrange-order'); ?></h2>
	            </div>
	            <div class="modal-body">
								<ul class="sortable media-list">
									<?php $__currentLoopData = $contents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $x => $vals): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<?php 
												$get = $vals->locales()->where('locale',config('app.locale'))->first();
											 ?>
										<li class="media">
											<?php echo Form::hidden('reorder[]',$vals->id); ?>

											<div class="media-left">
												<a href="#">
													<?php if($vals->media_type=="image"): ?>
														<img class="media-object" src="<?php echo e(asset($storage_url.'img/sections/'.$vals->media_url)); ?>" alt="" height="64px">
													<?php else: ?>
														<iframe src="<?php echo e($vals->media_url); ?>" frameborder="0" allowfullscreen height="64px" width="100px">
														</iframe>
													<?php endif; ?>
												</a>
											</div>
											<div class="media-body">
												<h4 class="media-heading"><?php echo e(isset($get->media_title) ? $get->media_title : $vals->media_title); ?></h4>
												<?php echo isset($get->media_content) ? $get->media_content : $vals->media_content; ?>

											</div>
										</li>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
								</ul>
	            </div>
	            <footer class="modal-footer">
	              <button type="submit" class="btn btn-primary"><?php echo app('translator')->getFromJson('backend.save'); ?></button>
	              <button class="btn btn-default" data-dismiss="modal"><?php echo app('translator')->getFromJson('backend.cancel'); ?></button>
	            </footer>
	          </div>
	        <?php echo Form::close(); ?>


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

<?php $__env->startSection('script'); ?>
<script type="text/javascript">
	$("#contentsTable").DataTable();
	$(".image-select").chosen();
	$(".sortable").sortable();

	$(document).ready(function(){
    $("#publishBtn").click(function(){
				var $page = $(this).attr('data-page');
				var $stat = $(this).attr('data-publish');
				if($stat == "publish"){
					var $newstat = "hidden";
				}else{
					var $newstat = "publish";
				}

        $.post("<?php echo e(url('/backend/settings/page_publish')); ?>",
        {
					_token: "<?php echo e(csrf_token()); ?>",
          page: $page,
          stat: $newstat,
        },
        function(data,status){
            if(status == "success"){
							var obj = $.parseJSON(data);
							if(obj.stat == "publish"){
								$("#publishBtn").find("i").removeClass('fa-eye-slash').addClass('fa-eye');
								$("#publishBtn").attr("data-publish","publish");
								$("#publishBtn").attr("title","This page is published");
								$("#"+obj.page+"stat").find("i").removeClass('fa-eye-slash').addClass('fa-eye');
								$("#"+obj.page+"stat").attr("title","This page is published");
							}else{
								$("#publishBtn").find("i").removeClass('fa-eye').addClass('fa-eye-slash');
								$("#publishBtn").attr("data-publish","hidden");
								$("#publishBtn").attr("title","This page is not published");
								$("#"+obj.page+"stat").find("i").removeClass('fa-eye').addClass('fa-eye-slash');
								$("#"+obj.page+"stat").attr("title","This page is not published");
							}
						}
        });
    });
});
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.masterBackend', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>