app/template/kaiino/Block/news.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% set NewsList = repository('Eccube\\Entity\\News').getList() %}
  9. {% block javascript %}
  10.     <script>
  11.       /*
  12.         $(function() {
  13.             $('.ec-newsRole__news').each(function() {
  14.                 $(this).parent().find('.ec-newsRole__newsItem').show();
  15.             });
  16.             $('.ec-newsRole__newsHeading').on('click', function() {
  17.                 $newsItem = $(this).parent('.ec-newsRole__newsItem');
  18.                 $newsDescription = $newsItem.children('.ec-newsRole__newsDescription');
  19.                 if ($newsDescription.css('display') == 'none') {
  20.                     $newsItem.addClass('is_active');
  21.                     $(this).find('img').attr('src','{{ asset("assets/icon/side-arrow-right-gray2.svg") }}');
  22.                     $newsDescription.slideDown(300);
  23.                     $(this).find('img').css({
  24.                       'transform':'rotate(90deg)'
  25.                     });
  26.                 } else {
  27.                     $(this).find('img').attr('src','{{ asset("assets/icon/side-arrow-right-gray2.svg") }}');
  28.                     $(this).find('img').css({
  29.                       'transform':'rotate(0deg)'
  30.                     });
  31.                     $newsItem.removeClass('is_active');
  32.                     $newsDescription.slideUp(300);
  33.                 }
  34.                 return false;
  35.             });
  36.         });*/
  37.     </script>
  38. {% endblock %}
  39. {% if NewsList|length > 0 %}
  40. <div class="ec-role" id="news">
  41.     <div class="ec-newsRole ec-contentRole">
  42.         <div class="ec-secHeading">
  43.             <div>
  44.                 <span class="ec-secHeading__en">{{ 'NEWS'|trans }}</span>
  45.                 <img src="{{ asset('assets/icon/slash.svg') }}" alt="" class="ec-slash is-pc">
  46.                 <span class="ec-secHeading__ja">{{ '新着情報'|trans }}</span>
  47.             </div>
  48.         </div>
  49.         <div class="ec-newsRole__news">
  50.             {% for News in NewsList %}
  51.                 <div class="ec-newsRole__newsItem">
  52.                     <a class="ec-newsRole__newsHeading" href="/news/view/{{ News.id }}">
  53.                         <div class="ec-newsRole__newsDate">
  54.                             {{ News.publish_date|date_day }}
  55.                         </div>
  56.                         <div class="ec-newsRole__newsColumn">
  57.                             <div class="ec-newsRole__newsTitle">
  58.                                 {{ News.title|raw }}
  59.                             </div>
  60.                         </div>
  61.                     </a>
  62.                 </div>
  63.             {% endfor %}
  64.         </div>
  65.         
  66.         {#<div class="ec-newsRole__news">
  67.             {% for News in NewsList %}
  68.                 <div class="ec-newsRole__newsItem">
  69.                     <div class="ec-newsRole__newsHeading">
  70.                         <div class="ec-newsRole__newsDate">
  71.                             {{ News.publish_date|date_day }}
  72.                         </div>
  73.                         <div class="ec-newsRole__newsColumn">
  74.                             <div class="ec-newsRole__newsTitle">
  75.                                 {{ News.title|raw }}
  76.                             </div>
  77.                             {% if News.description or News.url %}
  78.                                 <div class="ec-newsRole__newsClose">
  79.                                     <a class="ec-newsRole__newsCloseBtn">
  80.                                         <img src="{{ asset("assets/icon/side-arrow-right-gray2.svg") }}" alt="">
  81.                                     </a>
  82.                                 </div>
  83.                             {% endif %}
  84.                         </div>
  85.                     </div>
  86.                     <div class="ec-newsRole__newsDescription">
  87.                         {{ News.description|raw|nl2br }}
  88.                         {% if News.url %}
  89.                             <br>
  90.                             <a href="{{ News.url }}" {% if News.link_method == '1' %}target="_blank"{% endif %}>{{ '詳しくはこちら'|trans }}</a>
  91.                         {% endif %}
  92.                     </div>
  93.                 </div>
  94.             {% endfor %}
  95.         </div>#}
  96.     </div>
  97. </div>
  98. {% endif %}