{#
Copyright (C) SPREAD WORKS Inc. All Rights Reserved.
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{{ TabaCMSAsset('script.js','script')|raw }}
{{ TabaCMSAsset('style.css','style')|raw }}
{% if is_granted('ROLE_USER') %}
{% set customerRepository = repository('Eccube\\Entity\\Customer') %}
{% set customer = customerRepository.find(app.user.id) %}
{% set shop_name = [] %}
{% set flag = false %}
{% set index = customer.getCustomData(12) %}
{% if index|length > 0 %}
{% for i in 1..index|length %}
{% if index[i-1] == 10 %}
{% set shop_name = shop_name|merge(['大田店']) %}
{% elseif index[i-1] == 11 %}
{% set shop_name = shop_name|merge(['世田谷店']) %}
{% elseif index[i-1] == 12 %}
{% set shop_name = shop_name|merge(['横浜店']) %}
{% elseif index[i-1] == 13 %}
{% set shop_name = shop_name|merge(['大阪店']) %}
{% elseif index[i-1] == 14 %}
{% set shop_name = shop_name|merge(['名古屋店']) %}
{% endif %}
{% endfor %}
{% endif %}
{% if options.type_data_key == 'fair-information' %}
{% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
{% if post_list is not empty %}
<div class="sec" id="march">
<div class="march_in">
<div class="march_header" data-aos="fade-up">
<h2 class="march_main_ttl main_ttl">前日特別販売</h2>
<!--<p class="march_main_ttl2 main_ttl">MARCH</p>-->
</div>
<div class="slide-wrapper">
<div class="march_slide">
{% set no_image = asset('assets/img/march-sample.png' , 'user_data') %}
{% for post in post_list %}
{% set thumb = no_image %}
{% if post.getThumbnail is not empty %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
<div class="march_items" data-aos="fade-up">
{% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
<a href="{{ post.getURI }}">
<div class="march_img"><img src="{{thumb}}"></div>
<p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{% endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
<h3 class="march_ttl">{{ post.getTitle }}</h3>
<p>{{ post.getMemo }}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
<a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %}>
<div class="march_img"><img src="{{thumb}}"></div>
<p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{% endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
<h3 class="march_ttl">{{ post.getTitle }}</h3>
<p>{{ post.getMemo }}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
<a href="#">
<div class="march_img"><img src="{{thumb}}"></div>
<p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{% endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
<h3 class="march_ttl">{{ post.getTitle }}</h3>
<p>{{ post.getMemo }}</p>
</a>
{% endif %}
</div>
{% endfor %}
</div>
</div>
<div class="read_more text-right black_more">
<a href="/fair-information" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
</div>
</div>
</div>
{% endif %}
{% elseif options.type_data_key == 'function' %}
{% set PostRepository = repository('Plugin\\TabaCMS\\Entity\\Post') %}
{% set cat = customer.getCustomData(12) %}
{% set post_list1 = TabaCMSPostList({type_data_key:options.type_data_key, overwrite_query:false ,page_count:3}) %}
{% if post_list1 is not empty %}
<div class="sec" id="jurnal">
<div class="fixedcontainer">
<div class="jurnal_header">
<div class="jurnal_ttl" data-aos="fade-up">
<h2 class="jurnal_main_ttl main_ttl">Function JOURNAL</h2>
</div>
</div>
<div class="jurnal_list">
{% for post in post_list1 %}
{% if post.getThumbnail is empty %}
{% set thumb = asset('assets/img/jurnal-sample.png' , 'user_data') %}
{% else %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
<a href="{{ post.getURI }}" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
<div class="jurnal_img"><img src="{{thumb}}"></div>
<p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
<a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %} class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
<div class="jurnal_img"><img src="{{thumb}}"></div>
<p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
<a href="#" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
<div class="jurnal_img"><img src="{{thumb}}"></div>
<p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
</a>
{% endif %}
{% endfor %}
</div>
<div class="read_more text-right" data-aos="fade-up">
<a href="{{ type.getListURI }}" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
</div>
</div>
</div>
{% else %}
<div class="sec" id="jurnal">
<div class="fixedcontainer">
<div class="jurnal_header">
<div class="jurnal_ttl" data-aos="fade-up">
<h2 class="jurnal_main_ttl main_ttl">対応する投稿が存在しません。</h2>
</div>
</div>
</div>
</div>
{% endif %}
{% elseif options.type_data_key == 'buyer-information' %}
{% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
{% if post_list is not empty %}
<div id="buyer" class="sec">
<div class="fixedcontainer">
<h2 class="buyer_main_ttl main_ttl" data-aos="fade-up">OUR BUYERS</h2>
{# {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,category:cat , overwrite_query:false }) %} #}
<ul class="buyer_list">
{% set no_image = asset('assets/img/buyer-sample.png' , 'user_data') %}
{% for post in post_list %}
{% set thumb = no_image %}
{% if post.getThumbnail is not empty %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
{% set break = false %}
{% if shop_name is not empty %}
{% for i in 1..shop_name|length if not break %}
{% if post.getCategory is not empty %}
{% if shop_name[i-1] == post.getCategory.getCategoryName %}
{% set flag = true %}
{% set break = true %}
{% else %}
{% set flag = false %}
{% endif %}
{% else %}
{% set flag = false %}
{% set break = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if flag == true %}
<li data-aos="fade-up">
<div class="buyer_one btn-mm-light magic-hover magic-hover__square">
<div class="buyer_img"><img src="{{thumb}}"></div>
<p class="buyer_subttl">{%if post.category != null %}{{ post.category.categoryName }}{% endif %}</p>
<p class="buyer_ttl">{{ post.title }}</p>
</div>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% elseif options.type_data_key == 'buyer' %}
{% set post_list = TabaCMSPostList({type_data_key:'buyer-information',overwrite_query:false}) %}
{% if post_list is not empty %}
<div id="buyercomment" class="sec">
<div class="fixedcontainer">
<h2 class="buyercomment_main_ttl main_ttl" data-aos="fade-up">BUYER’S COMMENT</h2>
{# {% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,category:cat , overwrite_query:false }) %} #}
<div class="buyercomment_list">
{% set no_image = asset('assets/img/buyer-sample.png' , 'user_data') %}
{% for post in post_list %}
{% set thumb = no_image %}
{% if post.getThumbnail is not empty %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
{% set break = false %}
{% if shop_name is not empty %}
{% for i in 1..shop_name|length if not break %}
{% if post.getCategory is not empty %}
{% if shop_name[i-1] == post.getCategory.getCategoryName %}
{% set flag = true %}
{% set break = true %}
{% else %}
{% set flag = false %}
{% endif %}
{% else %}
{% set flag = false %}
{% set break = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if flag == true %}
<div class="buyercomment_items" data-aos="fade-up">
<div class="image"><img src="{{thumb}}"></div>
<div class="info" data-match-height="buyer">
<p class="tit">{{ post.title }}</p>
<p > {{ post.getBody|raw }}</p>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% endif %}
{% else %}
{% if options.type_data_key == 'fair-information' %}
<div class="sec" id="march">
<div class="march_in">
<div class="march_header" data-aos="fade-up">
<h2 class="march_main_ttl main_ttl">前日特別販売</h2>
<!--<p class="march_main_ttl2 main_ttl">MARCH</p>-->
</div>
<div class="slide-wrapper">
<div class="march_slide">
{% set no_image = asset('assets/img/march-sample.png' , 'user_data') %}
{% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
{% for post in post_list %}
{% set thumb = no_image %}
{% if post.getThumbnail is not empty %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
<div class="march_items" data-aos="fade-up">
{% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
<a href="{{ post.getURI }}">
<div class="march_img"><img src="{{thumb}}"></div>
<p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{% endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
<h3 class="march_ttl">{{ post.getTitle }}</h3>
<p>{{ post.getMemo }}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
<a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %}>
<div class="march_img"><img src="{{thumb}}"></div>
<p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{% endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
<h3 class="march_ttl">{{ post.getTitle }}</h3>
<p>{{ post.getMemo }}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
<a href="#">
<div class="march_img"><img src="{{thumb}}"></div>
<p class="march_date">{% if post.getCategory is not empty %}{{ post.getCategory.getCategoryName }}{% endif %} {{ post.getPublicDate|date('Y.m.d') }}</p>
<h3 class="march_ttl">{{ post.getTitle }}</h3>
<p>{{ post.getMemo }}</p>
</a>
{% endif %}
</div>
{% endfor %}
</div>
</div>
<div class="read_more text-right black_more">
<a href="/fair-information" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
</div>
</div>
</div>
{% elseif options.type_data_key == 'function' %}
<div class="sec" id="jurnal">
<div class="fixedcontainer">
<div class="jurnal_header">
<div class="jurnal_ttl" data-aos="fade-up">
<h2 class="jurnal_main_ttl main_ttl">Function JOURNAL</h2>
</div>
</div>
<div class="jurnal_list">
{% set post_list_1 = TabaCMSPostList({type_data_key:options.type_data_key, overwrite_query:false ,page_count:3}) %}
{% for post in post_list_1 %}
{% if post.getThumbnail is empty %}
{% set thumb = asset('assets/img/jurnal-sample.png' , 'user_data') %}
{% else %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% if post.getContentDiv == constant('CONTENT_DIV_BODY',post) %}
<a href="{{ post.getURI }}" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
<div class="jurnal_img"><img src="{{thumb}}"></div>
<p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_LINK',post) %}
<a href="{{ post.getLinkUrl }}" {% if post.getLinkTarget %}target="{{ post.getLinkTarget }}"{% endif %} class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
<div class="jurnal_img"><img src="{{thumb}}"></div>
<p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
</a>
{% elseif post.getContentDiv == constant('CONTENT_DIV_TITLE',post) %}
<a href="#" class="jurnal_three btn-mm-light magic-hover magic-hover__square" data-aos="fade-up">
<div class="jurnal_img"><img src="{{thumb}}"></div>
<p class="jurnal_txt"><span>{{ post.title }}</span>{{post.memo}}</p>
</a>
{% endif %}
{% endfor %}
</div>
<div class="read_more text-right" data-aos="fade-up">
<a href="{{ type.getListURI }}" class="btn-mm-light magic-hover magic-hover__square">Read More</a>
</div>
</div>
</div>
{% elseif options.type_data_key == 'buyer-information' %}
{% set no_image = asset('assets/img/jurnal-sample.png' , 'user_data') %}
{% set post_list = TabaCMSPostList({type_data_key:options.type_data_key,overwrite_query:false}) %}
<div id="buyer" class="sec">
<div class="fixedcontainer">
<h2 class="buyer_main_ttl main_ttl" data-aos="fade-up">OUR BUYERS</h2>
<ul class="buyer_list">
{% set no_image = asset('assets/img/buyer-sample.png' , 'user_data') %}
{% for post in post_list %}
{% set thumb = no_image %}
{% if post.getThumbnail is not empty %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
<li data-aos="fade-up">
<div class="buyer_one btn-mm-light magic-hover magic-hover__square">
<div class="buyer_img"><img src="{{ thumb }}"></div>
<p class="buyer_subttl">{%if post.category != null %}{{ post.category.categoryName }}{% endif %}</p>
<p class="buyer_ttl">{{ post.title }}</p>
</div>
</li>
{% endfor %}
</ul>
</div>
</div>
{% elseif options.type_data_key == 'buyer' %}
{% set no_image = asset('assets/img/jurnal-sample.png' , 'user_data') %}
{% set post_list = TabaCMSPostList({type_data_key:'buyer-information',overwrite_query:false}) %}
<div id="buyercomment" class="sec">
<div class="fixedcontainer">
<h2 class="buyer_main_ttl main_ttl" data-aos="fade-up">OUR BUYERS</h2>
<div class="buyercomment_list">
{% set no_image = asset('assets/img/buyer-sample.png' , 'user_data') %}
{% for post in post_list %}
{% set thumb = no_image %}
{% if post.getThumbnail is not empty %}
{% set thumb = asset(post.getThumbnail,'save_image') %}
{% endif %}
<div class="buyercomment_items" data-aos="fade-up">
<div class="image"><img src="{{ thumb }}"></div>
<div class="info">
<p class="tit">{{ post.title }}</p>
<p>{%if post.category != null %}{{ post.category.categoryName }}{% endif %}</p>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% endif %}
<script>
$(function() {
// 0個
if( $('div.march_img').length == '0' ){
$('div#march').hide();
}
});
</script>