<style>
.review-show-on-more {
display: none;
}
#review-show-more-area {
text-align: right;
width: 95%;
margin: 10px auto;
}
#review-show-more-button {
border: solid 1px #333;
font-size: 12px;
padding: 4px;
-webkit-appearance: none;
background: #ccc;
border-radius: 0;
}
</style>
{% if review is defined %}
{% set count = 0 %}
{% set break = false %}
<div id="wrap" style="margin-top: 15px;">
<div id="voice" class="voice-box" style="border: 1px solid #ccc;">
<div class="title">
<h2>この商品を買ったお客様の評価{#({{ php_count(review) }})#}</h2>
</div>
<ul style="width: 95%; margin: 0 auto; margin-top: 10px;">
{% for r_idx, v in review if not break %}
{% if count >= 5 %}
{% set break = true %}
{% endif %}
<li style="border: 1px solid #ccc; padding: 10px;" {% if r_idx > 2 %}class="review-show-on-more"{% endif %}>
<dl>
<dt style="margin-bottom: 5px;">評価:<b>{{ v['cr_points'] }}</b>
{% for i in 0..4 %}
{% if i < v['cr_points'] %}
<span style="color: #ffa462; font-size: 16px;">★</span>
{% else %}
<span style="color: #c5c5c5; font-size: 16px;">★</span>
{% endif %}
{% endfor %}
</dt>
<dd>
<p style="margin-bottom: 5px;">{% if v['cr_staff_comment'] is defined and v['cr_staff_comment'] != '' %} {{ v['cr_staff_comment'] | display_text | raw }} {% elseif v['cr_comment'] is defined and v['cr_comment'] != '' %}{{ v['cr_comment'] | display_text | raw }}{% endif %}</p>
<span style="color: #999;">投稿した日:{{ php_date('Y/m/d', php_strtotime(v['app_datetime'])) }}</span>
</dd>
</dl>
</li>
{% endfor %}
</ul>
{% if php_count(review) > 3 %}
<div id="review-show-more-area">
<input id="review-show-more-button" type="button" value="▼もっと見る">
</div>
{% endif %}
</div><!-- /#voice -->
</div><!-- /#wrap -->
{% endif %}
<script>
$('#review-show-more-button').on('click', function(){
$('#voice li.review-show-on-more').toggle();
$(this).hide();
});
</script>