<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
/**
 * Template for filter items block
 *
 * @var $block \Magento\LayeredNavigation\Block\Navigation\FilterRenderer
 */
?>

<ol class="items">
    <?php foreach ($filterItems as $filterItem): ?>
        <li class="item">
            <?php if ($filterItem->getCount() > 0): ?>
                <a href="<?php echo $block->escapeUrl($filterItem->getUrl()) ?>">
                    <?php /* @escapeNotVerified */ echo $filterItem->getLabel() ?>
                    <?php if ($this->helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer()): ?>
                        <span class="badge badge-primary">
                            <?php /* @escapeNotVerified */ echo $filterItem->getCount()?>
                        </span>
                    <?php endif; ?>
                </a>
            <?php else:?>
                <?php /* @escapeNotVerified */ echo $filterItem->getLabel() ?>
                <?php if ($this->helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer()): ?>
                    <span class="badge badge-primary">
                        <?php /* @escapeNotVerified */ echo $filterItem->getCount()?>
                    </span>
                <?php endif; ?>
            <?php endif; ?>
        </li>
    <?php endforeach ?>
</ol>
