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

// @codingStandardsIgnoreFile

?>
<?php
/**
 * Product list toolbar
 *
 * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
 */
use Magento\Catalog\Model\Product\ProductList\Toolbar;
?>
<div class="toolbar-sorter sorter form-inline">
    <label class="sorter-label col-form-label-sm" for="sorter"><?php /* @escapeNotVerified */ echo __('Sort By') ?></label>
    <select id="sorter" data-role="sorter" class="sorter-options form-control form-control-sm ml-2">
        <?php foreach ($block->getAvailableOrders() as $_key => $_order): ?>
            <option value="<?php /* @escapeNotVerified */ echo $_key; ?>"
                <?php if ($block->isOrderCurrent($_key)): ?>
                    selected="selected"
                <?php endif; ?>
                >
                <?php echo $block->escapeHtml(__($_order)) ?>
            </option>
        <?php endforeach; ?>
    </select>
    <?php if ($block->getCurrentDirection() == 'desc'): ?>
        <a title="<?php /* @escapeNotVerified */ echo __('Set Ascending Direction') ?>" href="#" class="action sorter-action sort-desc btn btn-default btn-sm" data-role="direction-switcher" data-value="asc">
            <span class="glyphicon glyphicon-arrow-up"></span>
        </a>
    <?php else: ?>
        <a title="<?php /* @escapeNotVerified */ echo __('Set Descending Direction') ?>" href="#" class="action sorter-action sort-asc btn btn-default btn-sm" data-role="direction-switcher" data-value="desc">
            <span class="glyphicon glyphicon-arrow-down"></span>
        </a>
    <?php endif; ?>
</div>
