<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>
<?php
$product = $block->getProductData();
$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$builderHelper = $this->helper('MGS\Fbuilder\Helper\Data');
?>
<?php if ($product->getId()): ?>
<div class="customer-review view">
    <div class="product-details">
        <div class="product-media">
            <a class="product-photo" href="<?php /* @escapeNotVerified */ echo $product->getProductUrl() ?>">
                <?php /* customer_account_product_review_page */ ?>
                <img class="img-fluid" src="<?= $_imagehelper->init($product, 'customer_account_product_review_page')->getUrl(); ?>" alt="<?= $block->stripTags($product->getName(), null, true); ?>" />
            </a>
        </div>
        <div class="product-info">
            <h2 class="product-name"><?= $block->escapeHtml($product->getName()) ?></h2>
			<?php if ($block->getRating() && $block->getRating()->getSize()): ?>
                <span class="rating-average-label"><?php /* @escapeNotVerified */ echo __('Average Customer Rating') ?></span>
				<span><?= $block->getReviewsSummaryHtml($product) ?></span>
            <?php endif; ?>
			<div class="review-details">
				<?php if ($block->getRating() && $block->getRating()->getSize()): ?>
					<div class="title">
						<strong><?php /* @escapeNotVerified */ echo __('Your Review'); ?></strong>
					</div>
					<div class="customer-review-rating">
						<?php foreach ($block->getRating() as $_rating): ?>
						<?php if ($_rating->getPercent()): ?>
							<?php $rating = ceil($_rating->getPercent()) ?>
							<div class="rating-summary item">
								<span class="rating-label"><span><?= $block->escapeHtml($_rating->getRatingCode()) ?></span></span>
								<div class="rating-result" title="<?php /* @escapeNotVerified */ echo $rating; ?>%">
									<span style="width:<?php /* @escapeNotVerified */ echo $rating; ?>%">
										<span><?php /* @escapeNotVerified */ echo $rating; ?>%</span>
									</span>
								</div>
							</div>
						<?php endif; ?>
						<?php endforeach; ?>
					</div>
					<div class="review-title"><?= $block->escapeHtml($block->getReviewData()->getTitle()) ?></div>
					<div class="review-content"><?= nl2br($block->escapeHtml($block->getReviewData()->getDetail())) ?></div>
					<div class="review-date">
						<?php /* @escapeNotVerified */ echo __('Submitted on %1', '<time class="date">' . $block->dateFormat($block->getReviewData()->getCreatedAt()) . '</time>') ?>
					</div>
				<?php endif; ?>
			</div>									
        </div>
    </div>

    
</div>
<div class="actions-toolbar">
    <div class="secondary">
        <a class="action back" href="<?php /* @escapeNotVerified */ echo $block->getBackUrl() ?>"><span><?php /* @escapeNotVerified */ echo __('Back to My Reviews') ?></span></a>
    </div>
</div>
<?php endif; ?>
