<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2022 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php if ($this->getReviewsCount()): ?>
    <div class="ratings">
        <?php if ($this->getRatingSummary()):?>
            <div class="rating-box">
                <div class="rating" style="width:<?= $this->getRatingSummary() ?>%"></div>
            </div>
        <?php endif ?>
        <span class="amount"><a href="#" onclick="var t = opener ? opener.window : window; t.location.href='<?= $this->getReviewsUrl() ?>'; return false;"><?= $this->__('%d Review(s)', $this->getReviewsCount()) ?></a></span>
    </div>
<?php elseif ($this->getDisplayIfEmpty()): ?>
    <p class="no-rating"><a href="<?= $this->getReviewsUrl() ?>#review-form"><?= $this->__('Be the first to review this product') ?></a></p>
<?php endif ?>
