{% set NewsList = repository('Eccube\\Entity\\News').getList() %}
{% block javascript %}
<script>
$(function() {
$('.p-top__news__box').each(function() {
var listLength = $(this).find('.ec-newsRole__newsItem').length;
if (listLength > 5) {
$(this).find('.ec-newsRole__newsItem:gt(4)').each(function() {
$(this).hide();
});
$(this).append('<a id="news_readmore" class="ec-inlineBtn--top">{{ 'もっと見る'|trans }}</a>');
var dispNum = 5;
$(this).find('#news_readmore').click(function() {
dispNum += 5;
$(this).parent().find('.ec-newsRole__newsItem:lt(' + dispNum + ')').show();
if (dispNum >= listLength) {
$(this).hide();
}
})
}
});
$('.ec-newsRole__newsHeading').on('click', function() {
$newsItem = $(this).parent('.ec-newsRole__newsItem');
$newsDescription = $newsItem.children('.ec-newsRole__newsDescription');
if ($newsDescription.css('display') == 'none') {
$newsItem.addClass('is_active');
$newsDescription.slideDown(300);
} else {
$newsItem.removeClass('is_active');
$newsDescription.slideUp(300);
}
return false;
});
});
</script>
{% endblock %}
<!-- start customer -->
{#<section class="p-top__customer">#}
{# <img class="absolute1" src="{{asset ('/test-ec-04/html/user_data/assets/img/common/cloud__gl2.webp')}}" alt="雲">#}
{# <img class="absolute2" src="{{asset ('/test-ec-04/html/user_data/assets/img/common/cloud_gl1.webp')}}" alt="雲">#}
{# <img class="absolute3" src="{{asset ('/test-ec-04/html/user_data/assets/img/common/meetbox.webp')}}" alt="お肉BOX">#}
{# <div class="section__title">#}
{# <img src="{{asset ('/test-ec-04/html/user_data/assets/img/common/cow.webp')}}" alt="牛のイラスト">#}
{# <h2>お客様の声</h2>#}
{# </div>#}
{# <div class="p-top__customer__box">#}
{# <div class="p-top__customer__box__item">#}
{# <img src="{{asset ('/test-ec-05/html/user_data/assets/img/common/hamburg.webp')}}" alt="ハンバーグ">#}
{# <h3 class="p-top__customer__box__item__title">定期的に食べたくなるハンバーグ</h3>#}
{# <p class="p-top__customer__box__item__text">焼き肉が一番だけど定期的に食べたくなるのがハンバーグ!珍しいタイプの懐かしさを感じる煮込みハンバーグは舌でほぐせるくらいほろほろのお肉。上質なお肉を使ってるから出来る味は家庭では再現できない満足感があります。</p>#}
{# <p class="p-top__customer__box__item__prof">20代 | 女性 |<img src="{{asset ('/test-ec-04/html/user_data/assets/img/common/star.webp')}}" alt=""></p>#}
{# </div>#}
{# <div class="p-top__customer__box__item">#}
{# <img src="{{asset ('/test-ec-05/html/user_data/assets/img/common/bbq.webp')}}" alt="BBQ">#}
{# <h3 class="p-top__customer__box__item__title">友人とバーベキュー!!</h3>#}
{# <p class="p-top__customer__box__item__text">夏なのでバーベキューということで、モーサイドさんからBBQセットを注文して友人と食べました!<br><br>#}
{# 安いのにとても美味しかったです!!<br>また注文します!<br>#}
{# </p>#}
{# <p class="p-top__customer__box__item__prof">20代 | 男性 |<img src="{{asset ('/test-ec-04/html/user_data/assets/img/common/star.webp')}}" alt=""></p>#}
{# </div>#}
{# <div class="p-top__customer__box__item">#}
{# <img src="{{asset ('/test-ec-05/html/user_data/assets/img/common/family.webp')}}" alt="焼肉">#}
{# <h3 class="p-top__customer__box__item__title">家族と自分へのご褒美に!</h3>#}
{# <p class="p-top__customer__box__item__text">#}
{# 家族と自分へのご褒美に少しプチ贅沢!<br>#}
{# お肉も柔らかくて美味しいのに安い。<br><br>#}
{# リピート確定です。<br>#}
{# また注文します!!<br><br>#}
{# </p>#}
{# <p class="p-top__customer__box__item__prof">30代 | 女性 |<img src="{{asset ('/test-ec-04/html/user_data/assets/img/common/star.webp')}}" alt=""></p>#}
{# </div>#}
{# </div>#}
{# <a href="#" class="more__page">もっと見る</a>#}
{#</section>#}
<!-- end customer -->
<!-- start top_news -->
<section class="p-top__news">
<div class="section__title">
<div class="image-wrapper">
<img src="{{asset ('/test-ec-05/html/user_data/assets/img/common/Cow3.png')}}" alt="牛さん">
</div>
<h2>お知らせ</h2>
</div>
<div class="ec-newsRole__news">
<div class="p-top__news__box">
{% for News in NewsList %}
<div class="ec-newsRole__newsItem p-top__news__box__item">
<div class="ec-newsRole__newsHeading">
<div class="ec-newsRole__newsDate p-top__news__box__item__date">
{{ News.publish_date|date_day }}
</div>
<span>お知らせ</span>
<div class="ec-newsRole__newsColumn">
<div class="ec-newsRole__newsTitle">
{{ News.title }}
</div>
{% if News.description or News.url %}
<div class="ec-newsRole__newsClose">
<a class="ec-newsRole__newsCloseBtn">
<i class="fas fa-angle-down"></i>
</a>
</div>
{% endif %}
</div>
</div>
<div class="ec-newsRole__newsDescription ">
{{ News.description|raw|nl2br }}
{% if News.url %}
<br>
<a href="{{ News.url }}" {% if News.link_method == '1' %}target="_blank"{% endif %}>{{ '詳しくはこちら'|trans }}</a>
{% endif %}
</div>
</div>
{% endfor %}
</div>
</div>
</section>
<!-- end top__news -->
{% block sytlesheet %}
<style>
.p-top__news__box__item__date {
display: inline-block;
}
.ec-newsRole__newsColumn {
display: flex;
justify-content: space-between;
}
#news_readmore {
padding: 10px 24px;
margin-top: 15px;
}
</style>
{% endblock %}