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


<?php $__env->startSection('Contenido'); ?>
<div class="row">
	<div class="col-md-12">
		<h2><i class="fa fa-dot-circle-o"></i> Páginas de captura </h2>
	</div><!--/col-md-12-->
</div><!--/row-->

<div class="row">
	<div class="col-md-12">
		<?php if(Session::has('message')): ?>
		<div class="alert alert-info"><?php echo Session::get('message'); ?></div>
		<?php endif; ?>
	</div>
</div>


<div class="row">
	<div class="col-md-12">
		<div class="block-web">
			<div class="header"> <h3 class="content-header"> Configuración de posicionamiento en buscadores </h3> </div>
			<div class="porlets-content">
				<?php echo Form::open(array('route' => 'SysWebPAterrizajePlantillaxClienteSeoGuardar', 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true)); ?>

					<div class="form-group">
						<label class="col-sm-3 control-label"> Title </label>
						<div class="col-sm-9">
							<?php echo Form::text('title', $PlantillaxCliente->nombre,  array('class' => 'form-control', 'placeholder' => '')); ?>

							<span class="text-danger" id="errtitle"> <?php echo $errors->first('title'); ?> </span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Desctiption </label>
						<div class="col-sm-9">
							<?php echo Form::textarea('description', null, array('class' => 'form-control', 'rows' => '6')); ?>

							<span class="text-danger" id="errdescription"> <?php echo $errors->first('description'); ?> </span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Keywords </label>
						<div class="col-sm-9">
							<?php echo Form::text('keywords', '',  array('class' => 'form-control', 'placeholder' => '')); ?>

							<span class="text-danger" id="errkeywords"> <?php echo $errors->first('keywords'); ?> </span>
						</div>
					</div>
					<?php $clon = ($PlantillaxCliente->padre!='')?true:false; ?>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Indexación de búsquedas </label>
						<div class="col-sm-9">
							<div class="checkbox">
								<label>
									<input name="index" type="checkbox" value="1" <?php if($clon): ?> checked <?php endif; ?>>
									<span class="custom-checkbox"></span> Evitar que los rastreadores web de la mayoría de motores de búsqueda indexen la página.
								</label>
							</div>
							<span class="text-danger" id="errindex"> <?php echo $errors->first('index'); ?> </span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Seguimiento de página </label>
						<div class="col-sm-9">
							<div class="checkbox">
								<label>
									<input name="follow" type="checkbox" value="1" <?php if($clon): ?> checked <?php endif; ?>>
									<span class="custom-checkbox"></span> No seguir los enlaces de esta página.
								</label>
							</div>
							<span class="text-danger" id="errfollow"> <?php echo $errors->first('follow'); ?> </span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label"> Ruta </label>
						<div class="col-sm-9">
							<div class="input-group">
								<?php echo Form::text('url', strtolower(str_replace(' ', '-', $PlantillaxCliente->nombre)),  array('class' => 'form-control', 'placeholder' => '', 'readonly'=>'', 'id' => 'txtUrl')); ?>

								<div class="input-group-btn">
									<button type="button" class="btn btn-warning tooltips" data-toggle="tooltip" data-original-title="Editar" id="btnEditarUrl" value="0">
										<i class="fa fa-pencil-square-o"></i>
									</button>
								</div>
							</div>
							<span class="text-danger" id="errurl"> <?php echo $errors->first('url'); ?> </span>
						</div>
					</div>
					<?php echo Form::hidden('plantillasxclientes_id', $PlantillaxCliente->id); ?>

					<div class="bottom">
						<?php echo Form::button('Guardar', array('class' => 'btn btn-primary', 'id' => 'btnAgregar', 'type' => 'submit')); ?>

						<?php echo HTML::linkRoute('SysWebPAterrizajePlantillaxCliente', 'Cancelar', array(), array('class' => 'btn btn-default')); ?>

					</div>
				<?php echo Form::close(); ?>

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

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

<?php $__env->startSection('JSOr'); ?>
$("#btnEditarUrl").click(function(){
	if($(this).val() == 0){
		$(this).val(1).attr("data-original-title", "Listo").html('<i class="fa fa-check"></i>');
		$("#txtUrl").prop("readonly", false).focus();
	}
	else{
		var url = $("#txtUrl").val();
		url = url.toLowerCase().replace(" ", "-");
		$("#txtUrl").val(url).prop("readonly", true);
		$(this).val(0).attr("data-original-title", "Editar").html('<i class="fa fa-pencil-square-o"></i>');		
	}
});
$("#frmAgregar").submit(function(e){
	e.preventDefault();
	$("#btnAgregar").prop("disabled", true).html('<i class="fa fa-spinner fa-spin"></i> Cargando');
	$.post(
		"<?php echo URL::route('SysWebPAterrizajePlantillaxClienteSeoGuardar'); ?>",
		$("#frmAgregar").serialize(),
		function(data){
			$("#btnAgregar").prop("disabled", false).html("Guardar");
			if(data.success){
				new PNotify({ title: "Realizado", text: data.mensaje, type: "success" });
				setTimeout( function(){ window.location.href = "<?php echo URL::route('SysWebPAterrizajePlantillaxCliente'); ?>"; }, 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(""); } });
			}
		},
		"json"
	);
});
<?php $__env->stopSection(); ?>
<?php echo $__env->make('BaseSistemaWeb', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>