<?php $__env->startSection('title', 'Categories - List'); ?>

<?php $__env->startSection('content_header', 'Categories <small>categories list</small>'); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">Categories</h3>
                    <div class="box-tools">
                        <a href="<?php echo e(route('admin.categories.create')); ?>" class="btn btn-box-tool" data-toggle="tooltip" title="Create" data-widget="chat-pane-toggle" data-original-title="Create"><i class="fa fa-plus"></i> Create</a>
                    </div>
                </div>
                <?php if(count($categories) > 0): ?>
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <tr>
                                <th><?php echo $__env->make('admin._partials.sort_snippet', ['_field' => 'id', '_title' => '#'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?></th>
                                <th><?php echo $__env->make('admin._partials.sort_snippet', ['_field' => 'title', '_title' => 'Title'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?></th>
                                <th>Status</th>
                                <th><?php echo $__env->make('admin._partials.sort_snippet', ['_field' => 'sorting', '_title' => 'Sorting'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?></th>
                                <th>Jobs</th>
                                <th>Views</th>
                                <th><?php echo $__env->make('admin._partials.sort_snippet', ['_field' => 'created_at', '_title' => 'Created at'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?></th>
                                <th><?php echo $__env->make('admin._partials.sort_snippet', ['_field' => 'updated_at', '_title' => 'Updated at'], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?></th>
                                <th>&nbsp;</th>
                            </tr>
                            <?php foreach($categories as $category): ?>
                                <tr>
                                    <td><?php echo e($category->id); ?></td>
                                    <td><a href="<?php echo e(route('admin.categories.show', $category->id)); ?>"><?php echo e($category->title); ?></a></td>
                                    <td>
                                        <?php if($category->active): ?>
                                            <span class="label label-success">active</span>
                                        <?php else: ?>
                                            <span class="label label-default">inactive</span>
                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e($category->sorting); ?></td>
                                    <td><?php echo e($category->jobs()->count()); ?></td>
                                    <td><?php echo e((int) app('counter')->get('model.category.'.$category->id.'.opened.total')->getValue()); ?></td>
                                    <td><?php echo e($category->created_at); ?></td>
                                    <td><?php echo e($category->updated_at); ?></td>
                                    <td class="text-right">
                                        <?php if($category->active): ?>
                                            <a href="<?php echo e(route('admin.categories.deactivate', $category->id)); ?>" class="btn btn-info btn-xs confirm-action">Deactivate</a>
                                        <?php else: ?>
                                            <a href="<?php echo e(route('admin.categories.activate', $category->id)); ?>" class="btn btn-success btn-xs confirm-action">Activate</a>
                                        <?php endif; ?>
                                        <a href="<?php echo e(route('admin.categories.show', $category->id)); ?>" class="btn btn-success btn-xs">view</a>
                                        <a href="<?php echo e(route('admin.categories.edit', $category->id)); ?>" class="btn btn-warning btn-xs">edit</a>
                                        <a href="<?php echo e(route('admin.categories.delete', $category->id)); ?>" class="btn btn-danger btn-xs confirm-action">delete</a>
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        </table>
                    </div>
                    <?php if($categories->hasPages()): ?>
                        <div class="box-footer">
                            <?php echo $categories->render(); ?>

                        </div>
                    <?php endif; ?>
                <?php else: ?>
                    <div class="box-body">
                        <div class="alert alert-info">List is empty.</div>
                    </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>