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

<?php $__env->startSection('content'); ?>
    <h1 class="page-title">
        <a href="<?php echo e(url('foro')); ?>" title="Volver"><i class="icon-action-undo"></i></a> Temas Favoritos
        <small>Mis Temas</small>
    </h1>

    <div class="portlet light portlet-fit bordered">
        <div class="portlet-title" style="margin-bottom: 0">
            
            
            
            <div class="actions" style="padding-bottom: 0">
                <?php echo e(Form::open(array('id' => 'form-validation','route' => ['favoritos.search'], 'method' => 'get', 'class'=>'form-horizontal', 'style'=>'display: inline-block;'))); ?>

                <div class="input-icon">
                    <i class="fa fa-search"></i>
                    <?php echo Form::search('search', null, array('placeholder' => 'Buscar un tema...','class' => 'form-control', 'maxlength' => '50')); ?>

                </div>
                <input type="submit" style="display: none" />
                <?php echo Form::close(); ?>

            </div>
        </div>
        <div class="portlet-body forum-body">
            <div id="tema-container">
                <?php echo $__env->make('pages.foro.partials.favoritoslist', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            </div>
        </div>
    </div>
    <div id="Modal"></div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    <script>
        function removeFavorito(id) {
            var btn = $('#fav-' + id);
            btn.blur();
            btn.parent().parent().remove();
            if ($.trim($('#tema-container').html())==''){
                $('#tema-container').html('<label class="no-existen">No existen temas creados</label>');
            }

            $.ajax({
                url: '<?php echo e(url('foro/tema/removerfav')); ?>' + '/' + id,
                type: 'POST',
                success: function (data) {
                    $('#tema-container').html(data);
                },
                error: function (result) {
                    swal("Oops", "Ocurrió un error al realizar su solicitud. Por favor, vuelva a cargar la página.", "error");
                }
            });
        };
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('template.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>