{#
/*
* This file is part of the ProductReview plugin
*
* Copyright (C) 2016 LOCKON CO.,LTD. All Rights Reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#}
{% import _self as stars %}
{# 星テキスト生成用マクロ #}
{% macro stars(positive, negative) %}
{% set positive_stars = ["", "★", "★★", "★★★", "★★★★", "★★★★★"] %}
{% set negative_stars = ["", "☆", "☆☆", "☆☆☆", "☆☆☆☆", "☆☆☆☆☆"] %}
{{ positive_stars[positive] }}{{ negative_stars[negative] }}
{% endmacro %}
<style type="text/css">
#product_review_area {
border-top: 1px solid #E8E8E8;
padding-bottom: 0;
margin-bottom: 20px;
}
#product_review_area .ec-rectHeading {
cursor: pointer;
margin-top: 20px;
margin-bottom: 20px;
}
#product_review_area .ec-rectHeading.is_active i {
transform: rotate(180deg);
}
#product_review_area .review_list {
padding-left: 25px;
}
#product_review_area .review_list li {
margin-bottom: 16px;
}
#product_review_area .review_list .review_date {
font-weight: bold;
}
#product_review_area .recommend_average {
margin-left: 16px;
color: #DE5D50;
}
#product_review_area .review_list .recommend_level {
margin-left: 16px;
color: #DE5D50;
}
#product_review_area .review_list .recommend_name {
margin-left: 16px;
}
</style>
<script>
$(function() {
$('#product_review_area').appendTo($('.ec-layoutRole__main, .ec-layoutRole__mainWithColumn, .ec-layoutRole__mainBetweenColumn'));
$('#product_review_area .ec-rectHeading').on('click', function() {
$content = $('#reviewContent');
if ($content.css('display') == 'none') {
$(this).addClass('is_active');
$content.addClass('is_active');
$content.slideDown(300);
} else {
$(this).removeClass('is_active');
$content.removeClass('is_active');
$content.slideUp(300);
}
return false;
});
});
</script>
<!--▼レビューエリア-->
<div id="product_review_area" class="product_review_area">
<div class="ec-role">
{% set positive_avg_star = ProductReviewAvg %}
{% set negative_avg_star = 5 - positive_avg_star %}
<div class="ec-rectHeading is_active">
<h4>{{ 'product_review.front.product_detail.title'|trans }}
<!--平均の星の数-->
<span class="recommend_average">{{ stars.stars(positive_avg_star, negative_avg_star) }}</span>
<!--レビュー数-->
<span>({{ ProductReviewCount }})</span>
<span class="chevron pull-right">
<i class="fas fa-angle-up fa-lg"></i>
</span>
</h4>
</div>
<div id="reviewContent">
{% if ProductReviews %}
<ul class="review_list">
{% for ProductReview in ProductReviews %}
<li>
<p class="review_date">
<!--投稿日-->
{{ ProductReview.create_date|date_day }}
<!--投稿者-->
<span class="recommend_name">
{% if ProductReview.reviewer_url %}
<a href="{{ ProductReview.reviewer_url }}" rel="ugc nofollow"
target="_blank">{{ 'product_review.front.product_detail.name'|trans({ '%name%': ProductReview.reviewer_name }) }}</a>
{% else %}
{{ 'product_review.front.product_detail.name'|trans({ '%name%': ProductReview.reviewer_name }) }}
{% endif %}
</span>
<!--星の数-->
{% set positive_star = ProductReview.recommend_level %}
{% set negative_star = 5 - positive_star %}
<span class="recommend_level">
{{ stars.stars(positive_star, negative_star) }}
</span>
</p>
<!--タイトル-->
<strong>{{ ProductReview.title }}</strong>
<!--レビューコメント-->
<p>{{ ProductReview.comment|nl2br }}</p>
</li>
{% endfor %}
</ul>
{% else %}
<p>{{ 'product_review.front.product_detail.no_review'|trans }}</p>
{% endif %}
</div>
<div>
<a href="{{ url('product_review_index', { id: Product.id }) }}"
class="ec-inlineBtn--action">{{ 'product_review.front.product_detail.post_review'|trans }}</a>
</div>
</div>
<div class="accordion ec-role">
<details>
<summary>\教えてください!/<br>
<span class="small">あなたの声が「ステキの道しるべ」になります</span></summary>
<p>私たちは、一つひとつの商品がまっすぐ伝わるよう、心を込めて商品紹介をしています。<br>
ですが、実際に商品を手にしてくださった「リアルな声」に勝るものはありません。<br><br>
「この使い心地が好き」<br>
「こんな使い方もおすすめです」<br>
「リピートしている決め手は」<br><br>
そんな、あなただけの素直な声が、お気に入りアイテムと出会うための、何より大切な「道しるべ」となります。<br><br>
もしよろしければ、ほんのひとことでも構いません。<br>
あなたが感じた商品とのストーリーを、ぜひお聞かせいただけないでしょうか。<br>
温かいお声が集まることで、この場所がさらにお役に立てることを願っております。</p>
</details>
<P class="orange bold mb40">レビュー投稿で300ポイント贈呈!詳しくは「レビューを投稿」ボタンから</P>
<P class="bold center mb40"><a class="underline" href="https://cosme.owl-horie.com/#top-review">全商品の新着レビューを見る</a></P>
</div>
</div>
<!-- ▲レビューエリア -->