{% extends 'default_frame.twig' %}
{% block javascript %}{% endblock %}
{% block stylesheet %}
<style>
.pluginCMBblog .post_meta {
display: flex;
list-style: none;
margin: 0;
padding: 0;
width: 95%;
margin: 0 auto;
}
.pluginCMBblog .blog_category{
margin: 0;
padding: 0;
}
.pluginCMBblog .blog_category{
display: initial;
}
.pluginCMBblog .blog_category li{
display: initial;
border-right: 1px solid #ddd;
}
.pluginCMBblog .blog_category li:last-child {
border-right: none;
}
.pluginCMBblog .post_meta .post_meta_list{
padding-right: 2rem;
}
.pluginCMBblog .list_category_link{
color: #337ab7;
padding: 0 0.5rem;
}
.pluginCMBblog .main_image_blog{
padding: 3rem 0;
}
.pluginCMBblog .post_meta_list.time{
width: 15rem;
display: inline-table;
}
.pluginCMBblog .tag_dl{
display: flex;
}
.pluginCMBblog .blog_Title{
word-break: break-word;
margin-bottom: 20px;
}
.pluginCMBblog .cm_blog_main_image{
text-align: center;
}
.pluginCMBblog .cm_blog_main_image img{
max-width: 100%;
width: auto;
}
@media screen and (max-width: 768px){
.pluginCMBblog .post_meta {
display: block;
}
.pluginCMBblog .post_meta_list.time{
width: 100%;
}
}
</style>
{% endblock %}
{% block main %}
{% if is_granted('ROLE_USER') %}
{# 会員限定 #}
<div id="page_user_data" class="ec-role blog_detail pluginCMBblog">
<div class="ec-pageHeader">
<h1 class="blog_Title">{{ blog.title|raw }}</h1>
</div>
<ul class="post_meta ">
<li class="post_meta_list time"><i class="fas fa-calendar-alt"></i> {{blog.release_date|date('Y-m-d')}}</li>
<li class="post_meta_list">
<dl class="tag_dl">
<dt><i class="fas fa-tags"></i></dt>
<dd>
<ul class="blog_category">
{% for category in blog.getBlogCategories %}
<li class="{{category.getCategory.class|raw}}">
<a href="{{ url('cm_blog_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
{{ category.getCategory.getName|raw }}
</a>
</li>
{% endfor %}
</ul>
</dd>
</dl>
</li>
</ul>
<div class="ec-off1Grid">
<div class="ec-off1Grid__cell">
<div class="cm_blog_main_image">
{% if blog.getMainListImage %}
<img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
{% endif %}
</div>
<div class="ec-grid2__cell">
<div class="ec-productRole__profile">
<div class="ec-productRole__description">{{ blog.body|raw }}
</div>
</div>
</div>
</div>
</div>
</div>
{% else %}
{% if(blog.members == 1) %}
{# 会員限定 の ため エラー表示 #}
<div id="page_user_data" class="ec-role blog_detail pluginCMBblog">
<div class="ak-header">
<div class="ak-pageHeader">
<h1>NEWS</h1>
</div>
</div><!-- ak-header -->
<div class="ec-pageHeader">
<h1 class="blog_Title">会員限定 ニュース</h1>
</div>
<div class="ec-off1Grid">
<div class="ec-off1Grid__cell">
<div class="cm_blog_main_image">
{% if blog.getMainListImage %}
<img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
{% endif %}
</div>
<div class="ec-grid2__cell">
<div class="ec-productRole__profile">
<div class="ec-productRole__description">
この記事を閲覧するには、ユーザ登録が必要になります。
</div>
</div>
</div>
</div>
</div>
</div>
{% else %}
{# 一般公開 #}
<div id="page_user_data" class="ec-role blog_detail pluginCMBblog">
<div class="ak-header">
<div class="ak-pageHeader">
<h1>NEWS</h1>
</div>
</div><!-- ak-header -->
<div class="ec-pageHeader">
<h1 class="blog_Title">{{ blog.title|raw }}</h1>
</div>
<ul class="post_meta ">
<li class="post_meta_list time"><i class="fas fa-calendar-alt"></i> {{blog.release_date|date('Y-m-d')}}</li>
<li class="post_meta_list">
<dl class="tag_dl">
<dt><i class="fas fa-tags"></i></dt>
<dd>
<ul class="blog_category">
{% for category in blog.getBlogCategories %}
<li class="{{category.getCategory.class|raw}}">
<a href="{{ url('cm_blog_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
{{ category.getCategory.getName|raw }}
</a>
</li>
{% endfor %}
</ul>
</dd>
</dl>
</li>
</ul>
<div class="ec-off1Grid">
<div class="ec-off1Grid__cell">
<div class="cm_blog_main_image">
{% if blog.getMainListImage %}
<img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
{% endif %}
</div>
<div class="ec-grid2__cell">
<div class="ec-productRole__profile">
<div class="ec-productRole__description">{{ blog.body|raw }}
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}