ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/** @var Form $block */
|
||||
|
||||
use Magento\Review\Block\Form;
|
||||
|
||||
//phpcs:disable Generic.Files.LineLength
|
||||
?>
|
||||
<div class="block review-add">
|
||||
<div class="block-title"><strong><?= $block->escapeHtml(__('Write Your Own Review')) ?></strong></div>
|
||||
<div class="block-content">
|
||||
<?php if ($block->getAllowWriteReviewFlag()): ?>
|
||||
<form action="<?= $block->escapeUrl($block->getAction()) ?>" class="review-form" method="post" id="review-form" data-role="product-review-form" data-bind="scope: 'review-form'">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<?= $block->getChildHtml('form_fields_before') ?>
|
||||
<fieldset class="fieldset review-fieldset" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>">
|
||||
<legend class="legend review-legend"><span><?= $block->escapeHtml(__("Write a Review")) ?></span><strong><?= $block->escapeHtml($block->getProductInfo()->getName()) ?></strong></legend>
|
||||
<?php if ($block->getRatings() && $block->getRatings()->getSize()): ?>
|
||||
<span id="input-message-box"></span>
|
||||
<fieldset class="field required review-field-ratings">
|
||||
<div class="control">
|
||||
<div class="nested" id="product-review-table">
|
||||
<?php foreach ($block->getRatings() as $_rating): ?>
|
||||
<div class="field choice review-field-rating">
|
||||
<label class="label" id="<?= $block->escapeHtml($_rating->getRatingCode()) ?>_rating_label"><span><?= $block->escapeHtml($_rating->getRatingCode()) ?></span></label>
|
||||
<div class="control review-control-vote">
|
||||
<?php $options = $_rating->getOptions();?>
|
||||
<?php $iterator = 1; foreach ($options as $_option): ?>
|
||||
<input
|
||||
type="radio"
|
||||
name="ratings[<?= $block->escapeHtmlAttr($_rating->getId()) ?>]"
|
||||
id="<?= $block->escapeHtmlAttr(str_replace(' ', '_', $_rating->getRatingCode())) ?>_<?= $block->escapeHtmlAttr($_option->getValue()) ?>"
|
||||
value="<?= $block->escapeHtmlAttr($_option->getId()) ?>"
|
||||
class="radio"
|
||||
data-validate="{ 'rating-required':true}"
|
||||
aria-labelledby="<?= $block->escapeHtmlAttr(str_replace(' ', '_', $_rating->getRatingCode())) ?>_rating_label <?= $block->escapeHtmlAttr(str_replace(' ', '_', $_rating->getRatingCode())) ?>_<?= $block->escapeHtmlAttr($_option->getValue()) ?>_label" />
|
||||
<label
|
||||
class="rating-<?= $block->escapeHtmlAttr($iterator) ?>"
|
||||
for="<?= $block->escapeHtmlAttr(str_replace(' ', '_', $_rating->getRatingCode())) ?>_<?= $block->escapeHtmlAttr($_option->getValue()) ?>"
|
||||
title="<?= $block->escapeHtmlAttr(__('%1 %2', $iterator, $iterator > 1 ? __('stars') : __('star'))) ?>"
|
||||
id="<?= $block->escapeHtmlAttr(str_replace(' ', '_', $_rating->getRatingCode())) ?>_<?= $block->escapeHtmlAttr($_option->getValue()) ?>_label">
|
||||
<span><?= $block->escapeHtml(__('%1 %2', $iterator, $iterator > 1 ? __('stars') : __('star'))) ?></span>
|
||||
</label>
|
||||
<?php $iterator++; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<input type="hidden" name="validate_rating" class="validate-rating" value="" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php endif ?>
|
||||
<div class="review-fields-wrapper">
|
||||
<div class="field review-field-nickname required">
|
||||
<label for="nickname_field" class="label"><span><?= $block->escapeHtml(__('Nickname')) ?></span></label>
|
||||
<div class="control">
|
||||
<input type="text" name="nickname" id="nickname_field" class="input-text" data-validate="{required:true}" data-bind="value: nickname()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="field review-field-summary required">
|
||||
<label for="summary_field" class="label"><span><?= $block->escapeHtml(__('Summary')) ?></span></label>
|
||||
<div class="control">
|
||||
<input type="text" name="title" id="summary_field" class="input-text" data-validate="{required:true}" data-bind="value: review().title" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="field review-field-text required">
|
||||
<label for="review_field" class="label"><span><?= $block->escapeHtml(__('Review')) ?></span></label>
|
||||
<div class="control">
|
||||
<textarea name="detail" id="review_field" cols="5" rows="3" data-validate="{required:true}" data-bind="value: review().detail"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ox-add-fields -->
|
||||
<div class="actions-toolbar review-form-actions">
|
||||
<div class="primary actions-primary">
|
||||
<button type="submit" class="action submit primary"><span><?= $block->escapeHtml(__('Submit Review')) ?></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</form>
|
||||
<script type="text/x-magento-init">
|
||||
{
|
||||
"[data-role=product-review-form]": {
|
||||
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
|
||||
},
|
||||
"#review-form": {
|
||||
"Magento_Review/js/error-placement": {},
|
||||
"Magento_Review/js/validate-review": {},
|
||||
"Magento_Review/js/submit-review": {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php else: ?>
|
||||
<div class="message info notlogged" id="review-form">
|
||||
<div>
|
||||
<?= $block->escapeHtml(__('Only registered users can write reviews. Please <a href="%1">Sign in</a> or <a href="%2">create an account</a>', $block->getLoginLink(), $block->getRegisterUrl()), ['a']) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
use Magento\Framework\Escaper;
|
||||
use Magento\Framework\View\Helper\SecureHtmlRenderer;
|
||||
use Magento\Review\Block\Product\View\ListView;
|
||||
|
||||
/**
|
||||
* @var ListView $block
|
||||
* @var SecureHtmlRenderer $secureRenderer
|
||||
* @var Escaper $escaper
|
||||
*/
|
||||
|
||||
$_items = $block->getReviewsCollection()->getItems();
|
||||
$format = $block->getDateFormat() ?: \IntlDateFormatter::SHORT;
|
||||
?>
|
||||
<?php if (count($_items)):?>
|
||||
<div class="block review-list" id="customer-reviews">
|
||||
<div class="block-title">
|
||||
<strong><?= $escaper->escapeHtml(__('Customer Reviews')) ?></strong>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<div class="toolbar review-toolbar">
|
||||
<?= $block->getChildHtml('toolbar') ?>
|
||||
</div>
|
||||
<ol class="items review-items">
|
||||
<?php foreach ($_items as $_review):?>
|
||||
<li class="item review-item" itemscope itemprop="review" itemtype="http://schema.org/Review">
|
||||
<div class="review-content-left">
|
||||
<div class="review-details">
|
||||
<p class="review-author">
|
||||
<span class="review-details-label"><?= $escaper->escapeHtml(__('Review by')) ?></span>
|
||||
<strong class="review-details-value" itemprop="author"><?= $escaper->escapeHtml($_review->getNickname()) ?></strong>
|
||||
</p>
|
||||
<p class="review-date">
|
||||
<span class="review-details-label"><?= $escaper->escapeHtml(__('Posted on')) ?></span>
|
||||
<time class="review-details-value" itemprop="datePublished" datetime="<?= $escaper->escapeHtmlAttr($block->formatDate($_review->getCreatedAt(), $format)) ?>"><?= $block->escapeHtml($block->formatDate($_review->getCreatedAt(), $format)) ?></time>
|
||||
</p>
|
||||
</div>
|
||||
<?php if (count($_review->getRatingVotes())): ?>
|
||||
<div class="review-ratings">
|
||||
<?php foreach ($_review->getRatingVotes() as $_vote): ?>
|
||||
<div class="rating-summary item" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
|
||||
<span class="label rating-label">
|
||||
<span><?= $escaper->escapeHtml($_vote->getRatingCode()) ?></span>
|
||||
</span>
|
||||
<div class="rating-result"
|
||||
id="review_<?= /* @noEscape */ $_review->getReviewId()
|
||||
?>_vote_<?= /* @noEscape */ $_vote->getVoteId() ?>"
|
||||
title="<?= $escaper->escapeHtmlAttr($_vote->getPercent()) ?>%">
|
||||
<meta itemprop="worstRating" content = "1"/>
|
||||
<meta itemprop="bestRating" content = "100"/>
|
||||
<span>
|
||||
<span itemprop="ratingValue"><?= $escaper->escapeHtml($_vote->getPercent()) ?>%</span>
|
||||
</span>
|
||||
</div>
|
||||
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag(
|
||||
'width:' . $_vote->getPercent() . '%',
|
||||
'div#review_' . $_review->getReviewId() . '_vote_' . $_vote->getVoteId() . ' span'
|
||||
) ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="review-content-right">
|
||||
<div class="review-title" itemprop="name"><?= $escaper->escapeHtml($_review->getTitle()) ?></div>
|
||||
<div class="review-content" itemprop="description">
|
||||
<?= nl2br($escaper->escapeHtml($_review->getDetail())) ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<div class="toolbar review-toolbar">
|
||||
<?= $block->getChildHtml('toolbar') ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
+994
@@ -0,0 +1,994 @@
|
||||
// /**
|
||||
// * Copyright © Magento, Inc. All rights reserved.
|
||||
// * See COPYING.txt for license details.
|
||||
// */
|
||||
|
||||
//
|
||||
// Variables
|
||||
// _____________________________________________
|
||||
|
||||
@review-ratings-left: 280px;
|
||||
@reviews-indent-desktop: 30px;
|
||||
@reviews-item-indent-desktop: 50px;
|
||||
//
|
||||
// Common
|
||||
// _____________________________________________
|
||||
|
||||
& when (@media-common = true) {
|
||||
.product-info-main .product-reviews-summary .rating-summary{
|
||||
padding: 2px 7px;
|
||||
background: #000;
|
||||
}
|
||||
.extended-review-summary-wrapper{
|
||||
align-items: center;
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
> .review-ratings{
|
||||
display:inline-block;
|
||||
margin-right: 50px;
|
||||
}
|
||||
.number-of-ratings{
|
||||
display:inline-block;
|
||||
margin-right: 50px;
|
||||
.rating-item{
|
||||
font-weight: @font-weight__black;
|
||||
text-transform: uppercase;
|
||||
font-size: 13px;
|
||||
padding-bottom: 4px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
.rating-number{
|
||||
margin-right:10px;
|
||||
}
|
||||
.rating-percent{
|
||||
display: inline-block;
|
||||
}
|
||||
.rating-result{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
position:relative;
|
||||
width:120px;
|
||||
margin-right:10px;
|
||||
&:before{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: #4d4d4d;
|
||||
height: 3px;
|
||||
width:100%;
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
span{
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
&:before {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background: @main-color;
|
||||
height: 3px;
|
||||
content: '';
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.extended-review-button{
|
||||
display: inline-block;
|
||||
}
|
||||
.product.data.items{
|
||||
.review-fields-wrapper{
|
||||
padding: 30px 5px 5px;
|
||||
background:none;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs-style--minimal{
|
||||
.product.data.items{
|
||||
.fieldset > .review-field-ratings.field:not(.choice),
|
||||
.review-field-ratings{
|
||||
padding: 5px;
|
||||
background:none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.extended-review-summary{
|
||||
width: 100%;
|
||||
max-width: 280px;
|
||||
background: #000;
|
||||
margin-right: 50px;
|
||||
display:flex;
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
align-self: stretch;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.ratings-value{
|
||||
.lib-heading(h1);
|
||||
font-family: @main-font;
|
||||
display: inline-block;
|
||||
font-size: 60px;
|
||||
vertical-align: middle;
|
||||
margin-right: 15px;
|
||||
margin-bottom: 0;
|
||||
line-height: 1;
|
||||
color: @main-color;
|
||||
}
|
||||
.ratings-count{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
.label{
|
||||
font-size: 13px;
|
||||
font-weight: @font-weight__bold;
|
||||
text-transform: uppercase;
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.rating-result{
|
||||
&:before{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background: #4d4d4d;
|
||||
height: 5px;
|
||||
width:100%;
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
span{
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
&:before {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background: @main-color;
|
||||
height: 5px;
|
||||
content: '';
|
||||
display: block;
|
||||
}
|
||||
span{
|
||||
border: 0;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.review-content{
|
||||
font-family: @content-font;
|
||||
}
|
||||
.review-content-left{
|
||||
display: inline-block;
|
||||
margin-right: 35px;
|
||||
max-width: 280px;
|
||||
width: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
.review-content-right{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
max-width: 700px;
|
||||
flex:1;
|
||||
}
|
||||
.rating-summary {
|
||||
.lib-rating-summary(
|
||||
@_icon-content: '\62',
|
||||
@_icon-font: 'athlete2',
|
||||
@_icon-font-size: 11px,
|
||||
@_icon-letter-spacing: 3px,
|
||||
@_icon-color: #4d4d4d,
|
||||
@_icon-color-active: @main-color
|
||||
);
|
||||
.rating-label{
|
||||
font-weight: @font-weight__black;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 10px;
|
||||
font-size: 13px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
.rating-result {
|
||||
float:right;
|
||||
> span:before,
|
||||
&:before{
|
||||
font-style: normal !important;
|
||||
font-weight: normal !important;
|
||||
font-variant: normal !important;
|
||||
text-transform: none !important;
|
||||
speak: none;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
}
|
||||
}
|
||||
.review-list{
|
||||
.rating-summary {
|
||||
.lib-rating-summary(
|
||||
@_icon-content: '\69',
|
||||
@_icon-font: 'athlete2',
|
||||
@_icon-font-size: 33px,
|
||||
@_icon-letter-spacing: 4px,
|
||||
@_icon-color: #000000,
|
||||
@_icon-color-active: @main-color
|
||||
);
|
||||
.rating-result{
|
||||
width: 161px;
|
||||
}
|
||||
.rating-label{
|
||||
font-weight: @font-weight__black;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.rating-result {
|
||||
float:right;
|
||||
&:before,
|
||||
> span:before{
|
||||
font-size:29px;
|
||||
height:20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.product-reviews-summary,
|
||||
.table-reviews {
|
||||
.rating-summary {
|
||||
.lib-rating-summary-label-hide();
|
||||
}
|
||||
}
|
||||
|
||||
.review-control-vote {
|
||||
.lib-rating-vote(
|
||||
@_icon-content: '\68',
|
||||
@_icon-font: 'athlete2',
|
||||
@_icon-font-size: 45px,
|
||||
@_icon-letter-spacing: 3px,
|
||||
@_icon-color: #4d4d4d,
|
||||
@_icon-color-active: @main-color
|
||||
);
|
||||
&:before,
|
||||
label:before{
|
||||
line-height:22px;
|
||||
height:22px;
|
||||
}
|
||||
}
|
||||
.review-fields-wrapper{
|
||||
padding:40px;
|
||||
background:#f8f8f8;
|
||||
.field{
|
||||
label{
|
||||
font-weight: @font-weight__black;
|
||||
text-transform: uppercase;
|
||||
font-size: 13px;
|
||||
}
|
||||
.control{
|
||||
margin-bottom:20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.inputs-style--underlined{
|
||||
.review-fields-wrapper{
|
||||
.field{
|
||||
textarea,
|
||||
input{
|
||||
.ox-input-simple-underlined();
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.review-add {
|
||||
clear:both;
|
||||
margin-bottom: 50px;
|
||||
.review-form{
|
||||
.actions-toolbar.review-form-actions{
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
.fieldset .review-legend.legend{
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
#product-review-container{
|
||||
clear:both;
|
||||
}
|
||||
//
|
||||
// Add review block
|
||||
// ---------------------------------------------
|
||||
|
||||
.block {
|
||||
&.add.review {
|
||||
margin-bottom: @indent__xl;
|
||||
|
||||
> .title {
|
||||
.lib-heading(h2);
|
||||
}
|
||||
|
||||
.legend {
|
||||
.lib-heading(h3);
|
||||
margin: 0 0 @indent__base;
|
||||
}
|
||||
|
||||
.field.rating {
|
||||
.label,
|
||||
.control {
|
||||
display: inline-block;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.reviews.list {
|
||||
> .title {
|
||||
.lib-heading(h2);
|
||||
}
|
||||
|
||||
.review {
|
||||
&.item {
|
||||
margin-bottom: @indent__xl;
|
||||
}
|
||||
|
||||
&.title {
|
||||
.lib-heading(h3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.data.table.reviews {
|
||||
.rating-summary {
|
||||
margin-top: -4px;
|
||||
}
|
||||
}
|
||||
|
||||
.customer-review.view {
|
||||
margin-bottom: @indent__base;
|
||||
|
||||
.review.title,
|
||||
.ratings-summary,
|
||||
.product-details {
|
||||
margin-bottom: @indent__base;
|
||||
}
|
||||
}
|
||||
|
||||
.product-reviews-summary {
|
||||
display: table;
|
||||
margin: 0 0 22px 0;
|
||||
/*
|
||||
.products.wrapper.list & {
|
||||
margin: 0 auto;
|
||||
}*/
|
||||
|
||||
&.empty {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.rating-summary {
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.reviews-actions {
|
||||
display: table-cell;
|
||||
line-height: 22px;
|
||||
vertical-align: middle;
|
||||
|
||||
a {
|
||||
margin-right: @indent__xs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Desktop
|
||||
// _____________________________________________
|
||||
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
|
||||
/*.product-reviews-summary {
|
||||
.products.wrapper.list & {
|
||||
margin: 0;
|
||||
}
|
||||
}*/
|
||||
.review-content-left{
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
/* 2 columns review block on product page */
|
||||
.product-review--layout-2columns{
|
||||
&.catalog-product-view{
|
||||
&.page-layout-1column{
|
||||
.review-add{
|
||||
display: inline-block;
|
||||
width: 40%;
|
||||
width: calc(40% - 40px);
|
||||
margin-left: 40px;
|
||||
}
|
||||
.review-list{
|
||||
display: inline-block;
|
||||
width: 60%;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Common
|
||||
// _____________________________________________
|
||||
|
||||
& when (@media-common = true) {
|
||||
|
||||
.customer-review {
|
||||
.product-details {
|
||||
&:extend(.abs-add-clearfix all);
|
||||
margin-bottom: @indent__xl;
|
||||
}
|
||||
|
||||
.product-media {
|
||||
float: left;
|
||||
margin-right: 3%;
|
||||
max-width: 285px;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.review-details {
|
||||
.customer-review-rating {
|
||||
.lib-css(margin-bottom, @indent__base);
|
||||
|
||||
.item {
|
||||
.lib-css(margin-bottom, @indent__s);
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.review-title {
|
||||
.lib-heading(h3);
|
||||
.lib-css(font-weight, @font-weight__semibold);
|
||||
.lib-css(margin-bottom, @indent__base);
|
||||
}
|
||||
|
||||
.review-content {
|
||||
.lib-css(margin-bottom, @indent__base);
|
||||
}
|
||||
}
|
||||
|
||||
.product-reviews-summary {
|
||||
.rating-summary,
|
||||
.reviews-actions {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
.fieldset > .field.review-field-ratings{
|
||||
.lib-css(margin, @zero);
|
||||
width:100%;
|
||||
}
|
||||
.review-field-ratings {
|
||||
legend{
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
.review-field-rating {
|
||||
display: block;
|
||||
|
||||
.label,
|
||||
.control {
|
||||
display: inline-block;
|
||||
}
|
||||
.control {
|
||||
width:240px;
|
||||
float:right;
|
||||
min-height:20px;
|
||||
}
|
||||
.label {
|
||||
font-weight: @font-weight__bold;
|
||||
text-transform: uppercase;
|
||||
padding-bottom: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Review product page
|
||||
// ---------------------------------------------
|
||||
|
||||
.review {
|
||||
&-toolbar {
|
||||
//border-top: 1px solid @color-gray79;
|
||||
//margin: 0 0 @indent__base;
|
||||
text-align: center;
|
||||
|
||||
&:first-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pages {
|
||||
border-bottom: 1px solid @color-gray79;
|
||||
display: block;
|
||||
padding: @indent__base 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.limiter {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-add {
|
||||
.block-title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-form {
|
||||
max-width: 500px;
|
||||
.action.submit.primary {
|
||||
padding: 18px 27px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.fieldset &-legend.legend {
|
||||
&:extend(.abs-reset-left-margin all);
|
||||
.lib-heading(h3);
|
||||
margin-bottom: 20px;
|
||||
font-size: @h2__font-size;
|
||||
font-weight: @font-weight__black;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: -0.02em;
|
||||
|
||||
strong {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.fieldset > &-field-ratings.field:not(.choice),
|
||||
&-field-ratings {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 40px 40px 30px 40px;
|
||||
position: relative;
|
||||
> .control {
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
&-list {
|
||||
margin-bottom: 30px!important;
|
||||
|
||||
.block-title strong {
|
||||
/*display: block;
|
||||
margin-bottom: 30px;*/
|
||||
font-family: @title-font;
|
||||
font-size: @h2__font-size;
|
||||
font-weight: @font-weight__black;
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
}
|
||||
|
||||
&-item {
|
||||
.lib-clearer();
|
||||
border-bottom: 1px solid #e3e3e3;
|
||||
margin: 0;
|
||||
padding: 30px 0;
|
||||
display:flex;
|
||||
flex-flow: row;
|
||||
&:last-child {
|
||||
border-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-ratings {
|
||||
//display: table;
|
||||
margin-bottom: @indent__s;
|
||||
max-width: 100%;
|
||||
&:extend(.abs-rating-summary all);
|
||||
}
|
||||
&-details{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
&-author {
|
||||
display: inline;
|
||||
font-weight: @font-weight__black;
|
||||
text-transform: uppercase;
|
||||
font-size: 13px;
|
||||
strong{
|
||||
font-weight: @font-weight__black;
|
||||
}
|
||||
}
|
||||
&-date {
|
||||
font-size: 13px;
|
||||
color: #a2a2a2;
|
||||
}
|
||||
|
||||
&-title {
|
||||
.lib-heading(h3);
|
||||
font-size: 20px;
|
||||
text-transform: uppercase;
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
|
||||
/*&-content {
|
||||
margin-bottom: @indent__base;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Desktop
|
||||
// _____________________________________________
|
||||
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) {
|
||||
.review {
|
||||
/*&-form {
|
||||
max-width: 500px;
|
||||
}*/
|
||||
|
||||
&-ratings {
|
||||
//float: left;
|
||||
margin-bottom: 0;
|
||||
//max-width: @review-ratings-left - @indent__xl;
|
||||
}
|
||||
/*
|
||||
&-ratings ~ &-content,
|
||||
&-ratings ~ &-details {
|
||||
margin-left: @review-ratings-left;
|
||||
}*/
|
||||
|
||||
&-toolbar {
|
||||
//margin: 0 0 @reviews-indent-desktop;
|
||||
|
||||
.pages {
|
||||
padding: @reviews-indent-desktop 0;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldset &-legend.legend {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
&-item {
|
||||
padding: @reviews-item-indent-desktop 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__xs) {
|
||||
.review-fields-wrapper,
|
||||
.fieldset > .review-field-ratings.field:not(.choice),
|
||||
.review-field-ratings{
|
||||
padding: 25px;
|
||||
}
|
||||
.review-field-ratings .review-field-rating{
|
||||
.label,
|
||||
.control{
|
||||
display: block;
|
||||
float:none;
|
||||
}
|
||||
.control:not(:last-child){
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.label{
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width:@screen__m) and (max-width:@screen__l){
|
||||
|
||||
.extended-review-summary-wrapper {
|
||||
&.columns-3,
|
||||
&.columns-4{
|
||||
.extended-review-summary{
|
||||
max-width: 260px;
|
||||
margin-right: 30px;
|
||||
padding: 25px;
|
||||
}
|
||||
.number-of-ratings{
|
||||
margin-right: 30px;
|
||||
.rating-result{
|
||||
margin-right: 5px;
|
||||
width: 110px;
|
||||
}
|
||||
}
|
||||
> .review-ratings{
|
||||
margin-right: 30px;
|
||||
}
|
||||
.rating-summary .rating-label{
|
||||
padding-right: 12px;
|
||||
}
|
||||
> div:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
.extended-review-button{
|
||||
.action.primary{
|
||||
padding: 18px 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.review-content-left{
|
||||
max-width: 260px;
|
||||
margin-right: 30px;
|
||||
}
|
||||
}
|
||||
/*
|
||||
@media (min-width:991px) and (max-width:1024px){
|
||||
.extended-review-summary-wrapper.columns-4{
|
||||
.extended-review-button{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
|
||||
|
||||
.review {
|
||||
.fieldset &-legend.legend {
|
||||
font-size: @h2__font-size-mobile;
|
||||
}
|
||||
&-list {
|
||||
.block-title strong {
|
||||
font-size: @h2__font-size-mobile;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@media (min-width:768px) and (max-width:1024px){
|
||||
.extended-review-summary-wrapper{
|
||||
/*&.columns-4{
|
||||
.extended-review-button{
|
||||
display: none;
|
||||
}
|
||||
}*/
|
||||
&.columns-3{
|
||||
.extended-review-summary{
|
||||
padding: 25px;
|
||||
margin-right: 30px;
|
||||
max-width: 230px;
|
||||
}
|
||||
.number-of-ratings{
|
||||
margin-right: 30px;
|
||||
.rating-result{
|
||||
margin-right: 5px;
|
||||
width: 110px;
|
||||
}
|
||||
.rating-item .label{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> .review-ratings{
|
||||
margin-right: 30px;
|
||||
}
|
||||
> div:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.extended-review-summary-wrapper{
|
||||
&.columns-4{
|
||||
flex-wrap: wrap;
|
||||
.extended-review-summary{
|
||||
width: 50%;
|
||||
margin-right: 0;
|
||||
max-width: 50%;
|
||||
}
|
||||
.extended-review-button{
|
||||
order: 1;
|
||||
width: 50%;
|
||||
align-self: stretch;
|
||||
display:flex;
|
||||
.action.primary{
|
||||
width: 100%;
|
||||
flex-grow:1;
|
||||
align-self:stretch;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.number-of-ratings{
|
||||
order: 3;
|
||||
.rating-item{
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-justify-content: space-between;
|
||||
justify-content: space-between;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
.rating-number{
|
||||
margin-right: 20px;
|
||||
}
|
||||
.rating-percent{
|
||||
min-width: 80px;
|
||||
text-align: right;
|
||||
}
|
||||
.rating-result{
|
||||
-webkit-flex-grow: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
.review-ratings{
|
||||
order: 4;
|
||||
}
|
||||
.number-of-ratings,
|
||||
.review-ratings{
|
||||
-ms-flex-preferred-size: 0;
|
||||
flex-basis: 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:767px){
|
||||
.review-form{
|
||||
max-width:100%;
|
||||
}
|
||||
.review-item{
|
||||
flex-flow: column;
|
||||
}
|
||||
.extended-review-summary-wrapper{
|
||||
flex-wrap: wrap;
|
||||
margin: 0;
|
||||
margin-bottom: 20px;
|
||||
.extended-review-summary{
|
||||
max-width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.extended-review-button{
|
||||
order: 2;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
.action.primary{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.number-of-ratings{
|
||||
order: 3;
|
||||
.rating-item{
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-justify-content: space-between;
|
||||
justify-content: space-between;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
.rating-number{
|
||||
margin-right: 20px;
|
||||
}
|
||||
.rating-percent{
|
||||
min-width: 60px;
|
||||
text-align: right;
|
||||
}
|
||||
.rating-result{
|
||||
-webkit-flex-grow: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
.review-ratings{
|
||||
order: 4;
|
||||
}
|
||||
.number-of-ratings,
|
||||
.review-ratings{
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
> div {
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
.review-content-left{
|
||||
margin-bottom: 25px;
|
||||
display: block;
|
||||
margin-right:0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.product-info-main{
|
||||
.review-content-left{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
|
||||
.product-info-main{
|
||||
.review-form{
|
||||
max-width:100%;
|
||||
}
|
||||
.review-item{
|
||||
flex-flow: column;
|
||||
padding: 35px 0;
|
||||
}
|
||||
.extended-review-summary-wrapper{
|
||||
flex-wrap: wrap;
|
||||
margin: 0;
|
||||
margin-bottom: 20px;
|
||||
.extended-review-summary{
|
||||
max-width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
.extended-review-button{
|
||||
order: 2;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
.action.primary{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.number-of-ratings{
|
||||
order: 3;
|
||||
.rating-item{
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
-webkit-justify-content: space-between;
|
||||
justify-content: space-between;
|
||||
-webkit-align-items: center;
|
||||
align-items: center;
|
||||
}
|
||||
.rating-number{
|
||||
margin-right: 20px;
|
||||
}
|
||||
.rating-percent{
|
||||
min-width: 60px;
|
||||
text-align: right;
|
||||
}
|
||||
.rating-result{
|
||||
-webkit-flex-grow: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
.review-ratings{
|
||||
order: 4;
|
||||
}
|
||||
.number-of-ratings,
|
||||
.review-ratings{
|
||||
width: 100%;
|
||||
margin-right: 0;
|
||||
}
|
||||
> div {
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
.review-content-left{
|
||||
margin-bottom: 25px;
|
||||
display: block;
|
||||
margin-right:0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.product-info-main{
|
||||
.review-content-left{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'tabs',
|
||||
'collapsible'
|
||||
], function ($) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* @param {String} url
|
||||
* @param {*} fromPages
|
||||
*/
|
||||
function processReviews(url, fromPages) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
cache: true,
|
||||
dataType: 'html',
|
||||
showLoader: false,
|
||||
loaderContext: $('.product.data.items')
|
||||
}).done(function (data) {
|
||||
$('#product-review-container').html(data).trigger('contentUpdated');
|
||||
$('[data-role="product-review"] .pages a').each(function (index, element) {
|
||||
$(element).on('click', function (event) {
|
||||
//eslint-disable-line max-nested-callbacks
|
||||
processReviews($(element).attr('href'), true);
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
}).always(function () {
|
||||
if (fromPages == true) { //eslint-disable-line eqeqeq
|
||||
$('html, body').animate({
|
||||
scrollTop: $('#reviews').offset().top - 50
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return function (config) {
|
||||
var reviewTab = $(config.reviewsTabSelector),
|
||||
requiredReviewTabRole = 'tab';
|
||||
if (reviewTab.length) {
|
||||
if (reviewTab.attr('role') === requiredReviewTabRole && reviewTab.hasClass('active')) {
|
||||
processReviews(config.productReviewUrl, location.hash === '#reviews');
|
||||
} else {
|
||||
reviewTab.one('beforeOpen', function () {
|
||||
processReviews(config.productReviewUrl);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
processReviews(config.productReviewUrl);
|
||||
}
|
||||
$(function () {
|
||||
$('.product-info-main .reviews-actions a').on('click', function (event) {
|
||||
var anchor, addReviewBlock;
|
||||
|
||||
event.preventDefault();
|
||||
anchor = $(this).attr('href').replace(/^.*?(#|$)/, ''),
|
||||
addReviewBlock = $('#' + anchor);
|
||||
if (!$('.product.data.items #reviews[data-role="content"]').length && addReviewBlock.length) {
|
||||
$('html, body').animate({
|
||||
scrollTop: $('#' + anchor).offset().top - 50
|
||||
}, 300);
|
||||
}
|
||||
$('.product.data.items [data-role="content"]').each(function (index) {
|
||||
//eslint-disable-line
|
||||
if (this.id == 'reviews') { //eslint-disable-line eqeqeq
|
||||
let $wrap = jQuery('.product.data.items');
|
||||
if ($wrap.data('mageAccordion') || $wrap.data('mage-Accordion')) {
|
||||
$('.product.data.items').accordion('activate', index);
|
||||
} else {
|
||||
$('.product.data.items').tabs('activate', index);
|
||||
}
|
||||
$('html, body').animate({
|
||||
scrollTop: addReviewBlock.offset().top - 50
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user