<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
// @codingStandardsIgnoreFile
?>
<?php
/**
 * Category layered navigation state
 *
 * @var $block \Magento\LayeredNavigation\Block\Navigation\State
 */
?>
<?php $_filters = $block->getActiveFilters() ?>
<?php if (!empty($_filters)): ?>
    <div class="card">
        <div class="filter-current">
            <div class="card-header">
                <h6 class="block-subtitle filter-current-subtitle"
                    role="heading"
                    aria-level="2"
                    data-count="<?php echo count($_filters); ?>"><?php /* @escapeNotVerified */ echo __('Now Shopping by') ?></h6>
            </div>
            <div class="card-body">
                <ul class="items">
                    <?php foreach ($_filters as $_filter): ?>
                        <li class="item">
                            <?php
                            $clearLinkUrl = $_filter->getClearLinkUrl();
                            $currentFilterName = $block->escapeHtml(__($_filter->getName())) . " " . $block->stripTags($_filter->getLabel());
                            if ($clearLinkUrl):
                                ?>
                                <a class="action previous btn btn-default btn-xs" href="<?php /* @escapeNotVerified */ echo $_filter->getRemoveUrl() ?>"
                                   title="<?php /* @escapeNotVerified */ echo __('Previous') ?>">
                                    <span class="glyphicon glyphicon-backward"></span>
                                </a>
                                <a class="action remove"
                                   title="<?php echo $block->escapeHtml($_filter->getFilter()->getClearLinkText()) ?>"
                                   href="<?php /* @escapeNotVerified */ echo $clearLinkUrl ?>">
                                    <i class="fal fa-times"></i>
                                </a>
                            <?php else: ?>
                                <a class="action remove" href="<?php /* @escapeNotVerified */ echo $_filter->getRemoveUrl() ?>"
                                   title="<?php /* @escapeNotVerified */ echo $block->escapeHtml(__('Remove')) . " " . $currentFilterName; ?>">
                                    <i class="fal fa-times"></i>
                                </a>
                            <?php endif; ?>
                            <span class="filter-label"><?php echo $block->escapeHtml(__($_filter->getName())); ?></span>
                            <span class="filter-value label label-default"><?php /* @escapeNotVerified */ echo $block->stripTags($_filter->getLabel()) ?></span>
                        </li>
                    <?php endforeach; ?>
                </ul>
            </div>
        </div>
    </div>
<?php endif; ?>
