@extends('BaseSistemaWeb') @section('CSS') {{ HTML::style('WebPro/plugins/bootstrap-fileupload/bootstrap-fileupload.min.css') }} {{ HTML::style('WebPro/plugins/dropzone/dropzone.css') }} @stop @section('Contenido')

Video Tutoriales

Agregar recursos descargables

{{ Form::open(array('route' => array('SysWebVTutorialesModulosVideosRecursosAgregar', $Modulo->id, $Video->id), 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true, 'target' => 'upload_iframe')) }}
{{ Form::text('titulo','', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::file('ruta', array('class' => '', 'id' => 'ruta')) }}
{{ Form::button('Guardar', array('class' => 'btn btn-primary', 'id' => 'btnAgregar', 'type' => 'submit')) }}
{{ Form::close() }}
@stop @section('JS') {{ HTML::script('WebPro/plugins/ckeditor-new/ckeditor.js') }} {{ HTML::script('WebPro/plugins/bootstrap-fileupload/bootstrap-fileupload.min.js') }} {{ HTML::script('WebPro/plugins/dropzone/dropzone.min.js') }} @stop @section('JSOr') $("#frmAgregar").submit(function(e){ e.preventDefault(); for(instance in CKEDITOR.instances){ CKEDITOR.instances[instance].updateElement(); } $("#btnAgregar").prop("disabled", true).html(' Cargando'); var frmAgregar = new FormData(document.getElementById("frmAgregar")); if( $("#imagen").val() != "" ){ $("#errruta").html(); $("#imgruta").show(); } $.ajax({ type: "POST", url: "{{ URL::route('SysWebVTutorialesModulosVideosRecursosAgregar', array($Modulo->id, $Video->id)) }}", data: frmAgregar, cache: false, contentType: false, processData: false, dataType: "json", success: function(data){ $("#btnAgregar").prop("disabled", false).html("Guardar"); $("#imgruta").hide(); if(data.success){ new PNotify({ title: "Realizado", text: data.mensaje, type: "success" }); setTimeout( function(){ window.location.href = "{{ URL::route('SysWebVTutorialesModulosVideosRecursos', array($Modulo->id, $Video->id)) }}"; }, 3000 ); } else{ if(data.mensaje != ''){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); } $.each(data.errMensajes, function(key, value){ if(value != ''){ $("#err"+key).html(value); } else{ $("#err"+key).html(""); } }); } }, error: function(jqXHR, textStatus, errorThrown){ new PNotify({ title: "Error", text: textStatus + " " + errorThrown, type: "error" }); } }); }); @stop