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

<?php $__env->startSection('content_header'); ?>
<h1 class="m-0 text-dark">Kategorije</h1>
<div class="create_button">
    <a href="<?php echo e(URL::route('admin/categories-create')); ?>" class="btn btn-default"><?php echo e(Lang::get('Dodaj novu kategoriju')); ?></a>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<table id="data-table" class="display" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th><?php echo Lang::get('common.id'); ?></th>
            <th><?php echo Lang::get('common.name'); ?></th>
            <th><?php echo Lang::get('common.parent'); ?></th>
            <th><?php echo Lang::get('common.status'); ?></th>
            <th><?php echo Lang::get('common.actions'); ?></th>
        </tr>
    </thead>

    <tbody>
        <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <tr>
            <td><?php echo $item->id; ?></td>
            <td><?php echo $item->name; ?></a></td>
            <td><?php echo ($item->getMainCategory != null) ? $item->getMainCategory->name : ''; ?></td>
            <td><?php echo $item->getStatusName->name; ?></a></td>
            <td>
                <div class="btn-group post-category">
                    <button id="action-secondary-btn" data-toggle="dropdown" class="btn btn-warning dropdown-toggle"
                        data-original-title="" title="">
                        <?php echo e(Lang::get('Izaberi')); ?> <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                                <a href="<?php echo e(URL::route('admin/categories-edit', [$item->id])); ?>"><?php echo e(Lang::get('Izmijeni')); ?></a>
                        </li>
                        <li>
                            <form method="post" class="delete_form" action="<?php echo e(route('admin/categories.destroy', [$item->id])); ?>">
                                <?php echo method_field('DELETE'); ?>
                                <?php echo csrf_field(); ?>
                                <?php if($item->id > 1): ?>
                                    <button type="submit"><?php echo Lang::get('Obriši'); ?></button>
                                <?php endif; ?>
                            </form>                            
                        </li>
                    </ul>
                </div>
            </td>
        </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </tbody>
</table>
<?php echo e($categories->links()); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('js'); ?>
<?php $__env->startSection('plugins.Datatables', true); ?>
<script>
    $(document).ready(function() {

            $('#data-table').DataTable({
                "paging": false,
                "lengthChange": false,
                "searching": true,
                "ordering": true,
                "info": false,
                "autoWidth": false
            });
    } );


</script>
<style>
    .create_button{
        padding: 10px 0;
        margin-top: -40px;
        float: right;
        display: inline-block;
    }
    .create_button a{
        background: #48a2e8;
        color: #ffffff;
    }
</style>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Projects\laravel\laravel-shop\resources\themes\default\views/admin/categories/index.blade.php ENDPATH**/ ?>