app/template/akracing/web/detail.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% block javascript %}{% endblock %}
  3. {% block stylesheet %}
  4. <style>
  5. .pluginCMBblog .post_meta {
  6.     display: flex;
  7.     list-style: none;
  8.     margin: 0;
  9.     padding: 0;
  10.     width: 95%;
  11.     margin: 0 auto;
  12. }
  13. .pluginCMBblog .blog_category{
  14.     margin: 0;
  15.     padding: 0;
  16. }
  17. .pluginCMBblog .blog_category{
  18.     display: initial;
  19. }
  20. .pluginCMBblog .blog_category li{
  21.     display: initial;
  22.     border-right: 1px solid #ddd;
  23. }
  24. .pluginCMBblog .blog_category li:last-child {
  25.     border-right: none;
  26. }
  27. .pluginCMBblog .post_meta .post_meta_list{
  28.     padding-right: 2rem;
  29. }
  30. .pluginCMBblog .list_category_link{
  31.     color: #337ab7;
  32.     padding: 0 0.5rem;
  33. }
  34. .pluginCMBblog .main_image_blog{
  35.     padding: 3rem 0;
  36. }
  37. .pluginCMBblog .post_meta_list.time{
  38.     width: 15rem;
  39.     display: inline-table;
  40. }
  41. .pluginCMBblog .tag_dl{
  42.     display: flex;
  43. }
  44. .pluginCMBblog .blog_Title{
  45.     word-break: break-word;
  46.     margin-bottom: 20px;
  47. }
  48. .pluginCMBblog .cm_blog_main_image{
  49.     text-align: center;
  50. }
  51. .pluginCMBblog .cm_blog_main_image img{
  52.     max-width: 100%;
  53.     width: auto;
  54. }
  55. @media screen and (max-width: 768px){
  56.     .pluginCMBblog .post_meta {
  57.         display: block;
  58.     }
  59.     
  60.     .pluginCMBblog .post_meta_list.time{
  61.         width: 100%;
  62.     }   
  63. }
  64. </style>
  65. {% endblock %}
  66. {% block main %}
  67. {% if is_granted('ROLE_USER') %}
  68.     {# 会員限定 #}
  69.     <div id="page_user_data" class="ec-role blog_detail pluginCMBblog">
  70.         <div class="ec-pageHeader">
  71.             <h1 class="blog_Title">{{ blog.title|raw }}</h1>
  72.         </div>
  73.         <ul class="post_meta ">
  74.             <li class="post_meta_list time"><i class="fas fa-calendar-alt"></i>&nbsp;{{blog.release_date|date('Y-m-d')}}</li>
  75.             <li class="post_meta_list">
  76.                 <dl class="tag_dl">
  77.                     <dt><i class="fas fa-tags"></i></dt>
  78.                     <dd>
  79.                     <ul class="blog_category">
  80.                         {% for category in blog.getBlogCategories %}
  81.                             <li class="{{category.getCategory.class|raw}}">
  82.                                 <a href="{{ url('cm_blog_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
  83.                                 {{ category.getCategory.getName|raw }}
  84.                                 </a>
  85.                             </li>
  86.                         {% endfor %}
  87.                     </ul>
  88.                     </dd>
  89.                 </dl>
  90.             </li>
  91.         </ul>
  92.         <div class="ec-off1Grid">
  93.             <div class="ec-off1Grid__cell">
  94.                 <div class="cm_blog_main_image">
  95.                     {% if blog.getMainListImage %}
  96.                     <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
  97.                     {% endif %}
  98.                 </div>
  99.                 <div class="ec-grid2__cell">
  100.                     <div class="ec-productRole__profile">
  101.                         <div class="ec-productRole__description">{{ blog.body|raw }}
  102.                         </div>
  103.                     </div>
  104.                 </div>
  105.             </div>
  106.         </div>
  107.     </div>
  108. {% else %}
  109.     {% if(blog.members == 1) %}
  110.         {# 会員限定 の ため エラー表示 #}
  111.         <div id="page_user_data" class="ec-role blog_detail pluginCMBblog">
  112.                 <div class="ak-header">
  113.                     <div class="ak-pageHeader">
  114.                         <h1>NEWS</h1>
  115.                     </div>
  116.                 </div><!-- ak-header -->
  117.                 <div class="ec-pageHeader">
  118.                     <h1 class="blog_Title">会員限定 ニュース</h1>
  119.                 </div>
  120.                 <div class="ec-off1Grid">
  121.                     <div class="ec-off1Grid__cell">
  122.                         <div class="cm_blog_main_image">
  123.                             {% if blog.getMainListImage %}
  124.                             <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
  125.                             {% endif %}
  126.                         </div>
  127.                         <div class="ec-grid2__cell">
  128.                             <div class="ec-productRole__profile">
  129.                                 <div class="ec-productRole__description">
  130.                                     この記事を閲覧するには、ユーザ登録が必要になります。
  131.                                 </div>
  132.                             </div>
  133.                         </div>
  134.                     </div>
  135.                 </div>
  136.         </div>
  137.     {% else %}
  138.         {# 一般公開 #}
  139.         <div id="page_user_data" class="ec-role blog_detail pluginCMBblog">
  140.                 <div class="ak-header">
  141.                     <div class="ak-pageHeader">
  142.                         <h1>NEWS</h1>
  143.                     </div>
  144.                 </div><!-- ak-header -->
  145.             <div class="ec-pageHeader">
  146.                 <h1 class="blog_Title">{{ blog.title|raw }}</h1>
  147.             </div>
  148.             <ul class="post_meta ">
  149.                 <li class="post_meta_list time"><i class="fas fa-calendar-alt"></i>&nbsp;{{blog.release_date|date('Y-m-d')}}</li>
  150.                 <li class="post_meta_list">
  151.                     <dl class="tag_dl">
  152.                         <dt><i class="fas fa-tags"></i></dt>
  153.                         <dd>
  154.                         <ul class="blog_category">
  155.                             {% for category in blog.getBlogCategories %}
  156.                                 <li class="{{category.getCategory.class|raw}}">
  157.                                     <a href="{{ url('cm_blog_page_list', {categories: [category.getCategory().getId()]}) }}" class="list_category_link">
  158.                                     {{ category.getCategory.getName|raw }}
  159.                                     </a>
  160.                                 </li>
  161.                             {% endfor %}
  162.                         </ul>
  163.                         </dd>
  164.                     </dl>
  165.                 </li>
  166.             </ul>
  167.             <div class="ec-off1Grid">
  168.                 <div class="ec-off1Grid__cell">
  169.                     <div class="cm_blog_main_image">
  170.                         {% if blog.getMainListImage %}
  171.                         <img src="{{ asset(blog.getMainListImage|no_image_product, 'save_image') }}" class="main_image_blog"></img>
  172.                         {% endif %}
  173.                     </div>
  174.                     <div class="ec-grid2__cell">
  175.                         <div class="ec-productRole__profile">
  176.                             <div class="ec-productRole__description">{{ blog.body|raw }}
  177.                             </div>
  178.                         </div>
  179.                     </div>
  180.                 </div>
  181.             </div>
  182.         </div>
  183.     {% endif %}
  184. {% endif %}
  185. {% endblock %}