<?php $__env->startSection('CSS'); ?>
<?php echo HTML::style('VideoJS/video-js.css'); ?>

<?php echo HTML::script('VideoJS/videojs-ie8.min.js'); ?>

<?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 videos del módulo <?php echo $Modulo->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> Descripción </th>
								<th class="col-md-2"> Video </th>
								<th class="col-md-4"> Mantenimiento </th>
							</tr>
						</thead>
						<tbody>
							<?php $__empty_1 = true; foreach($Videos as $Video): $__empty_1 = false; ?>
							<tr>
								<td> <?php echo $Video->titulo; ?> </td>
								<td> <?php echo $Video->descripcion; ?> </td>
								<td>
									<video id="video" class="video-js" controls preload="auto" width="320" height="132" poster="" data-setup="{}">
										<source src="<?php echo $Video->ruta; ?>" type='video/mp4'>
									</video>
								</td>
								<td>
									<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideosEditar', 'Editar', array($Modulo->id, $Video->id), array('class' => 'btn btn-warning')); ?>

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

									<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideosRecursos', 'Recursos', array($Modulo->id, $Video->id), array('class' => 'btn btn-success')); ?>

									<?php echo HTML::linkRoute('SysWebVTutorialesModulosVideosVinculos', 'Vinculos', array($Modulo->id, $Video->id), array('class' => 'btn btn-success')); ?>

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

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

<?php $__env->startSection('JS'); ?>
<?php echo HTML::script('VideoJS/video.js'); ?>

<script type="text/javascript">
	function Eliminar(id){
		var id = id;
		$.post(
			"<?php echo URL::route('SysWebVTutorialesModulosVideosEliminar', array($Modulo->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('SysWebVTutorialesModulos'); ?>"; }, 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(); ?>