<?php
/**
 * Category sidebar
 *
 * @var $block Sebwite\Sidebar\Block\Sidebar
 */
$categories = $block->getCategories();
$brands     = $block->getBrands();

?>

<h3><?php echo __('Categories'); ?></h3>
<ul class="o-list">

    <?php
    // Loop through categories
    foreach ( $categories as $category ) :
        ?>
        <li class="level0<?php echo($block->isActive($category) ? ' active' : ''); ?>">
            <a href="<?php echo $block->getCategoryUrl($category); ?>" title="<?php echo $category->getName(); ?>" class="<?php echo($block->isActive($category) ? ' active' : ''); ?>">
                <?php echo $category->getName(); ?>
            </a>
            <?php if ( $category->hasChildren() ) : ?>
                <span class="expand"><?php echo $block->isActive($category) ? '<i class="fa fa-minus"></i>' : '<i class="fa fa-plus"></i>'; ?></span>
            <?php endif; ?>

            <?php echo $block->getChildCategoryView($category,'','',$block->isActive($category)); ?>
        </li>
    <?php endforeach; ?>
</ul>
<script type="text/javascript">
	/* Simply invoke iffe of sidebarmodule */
	require(['jquery','sidebarmodule'], function ($) {});
</script>