<?php $__env->startSection('CSS'); ?>
<?php echo HTML::style('jQueryLivePreview/css/livepreview-demo.css'); ?>

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


<?php $__env->startSection('Contenido'); ?>
<div class="row">
	<div class="col-md-12">
		<h2><i class="fa fa-video-camera"></i> Video tutoriales </h2>
	</div><!--/col-md-12-->
</div><!--/row-->

<div class="row">
	<div class="col-md-12">
		<div class="block-web">
			<div class="header"> <h3 class="content-header"> Listado de recursos descargables del video <?php echo $Video->titulo; ?> </h3> </div>
			<div class="porlets-content">
				<div class="table-responsive">
					<table class="table table-hover">
						<thead>
							<tr>
								<th class="col-md-2"> Título </th>
								<th> Recurso </th>
								<th class="col-md-2"> Mantenimiento </th>
							</tr>
						</thead>
						<tbody>
							<?php $__empty_1 = true; foreach($VinculosApoyos as $VinculoApoyo): $__empty_1 = false; ?>
							<tr>
								<td> <?php echo $VinculoApoyo->titulo; ?> </td>
								<td>
									<?php echo HTML::link($VinculoApoyo->ruta, $VinculoApoyo->titulo, array('target' => '_blank', 'class' => 'livepreview'), true); ?>

								</td>
								<td>
									<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideosVinculosEditar', 'Editar', array($Modulo->id, $Video->id, $VinculoApoyo->id), array('class' => 'btn btn-warning')); ?>

									<?php echo Form::button('Eliminar', array('class' => 'btn btn-danger', 'onclick' => 'Eliminar('.$Video->id.')')); ?>

								</td>
							</tr>
							<?php endforeach; if ($__empty_1): ?>
							<tr class="danger"> <td colspan="3"> No existe ningún recurso descargable agregado </td> </tr>
							<?php endif; ?>
						</tbody>
					</table>
				</div>
			</div>
			<div class="bottom">
				<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideosVinculosAgregar', 'Agregar', array($Modulo->id, $Video->id), array('class' => 'btn btn-primary')); ?>

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

<?php $__env->startSection('JS'); ?>
<?php echo HTML::script('jQueryLivePreview/js/jquery-live-preview.min.js'); ?>

<script type="text/javascript">
	function Eliminar(id){
		var id = id;
		$.post(
			"<?php echo URL::route('SysWebVTutorialesModulosVideosVinculosEliminar', array($Modulo->id, $Video->id)); ?>",
			{id:id},
			function(data){
				if(data.success){
					new PNotify({ title: "Realizado", text: data.mensaje, type: "success" });
					setInterval(function(){ window.location.href = "<?php echo URL::route('SysWebVTutorialesModulosVideosRecursos', array($Modulo->id, $Video->id)); ?>"; }, 1000);
				}
				else{
					if(data.mensaje != ""){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); }
				}
			},
			"json"
		);
	}
</script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('JSOr'); ?>
$(".livepreview").livePreview();
<?php $__env->stopSection(); ?>
<?php echo $__env->make('BaseSistemaWeb', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>