<?php $__env->startSection('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($RecursosDescargables as $Recurso): $__empty_1 = false; ?>
							<tr>
								<td> <?php echo $Recurso->titulo; ?> </td>
								<td>
									<div class="embed-responsive embed-responsive-4by3">
										<iframe class="embed-responsive-item" src="<?php echo asset('SysWeb/VideoTutoriales/RecursosDescargables/'.$Recurso->ruta); ?>"> </iframe>
									</div>
								</td>
								<td>
									<?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('SysWebVTutorialesModulosVideosRecursosAgregar', 'Agregar', array($Modulo->id, $Video->id), array('class' => 'btn btn-primary')); ?>

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

<?php $__env->startSection('JS'); ?>
<script type="text/javascript">
	function Eliminar(id){
		var id = id;
		$.post(
			"<?php echo URL::route('SysWebVTutorialesModulosVideosRecursosEliminar', 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'); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('BaseSistemaWeb', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>