app/template/BlackCherry/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 = newsRepository().getTopDisplayList() %}
  9. {% block javascript %}
  10.     <script>
  11.         $(function() {
  12.             $('.ec-newsRole__newsHeading').on('click', function() {
  13.                 $newsItem = $(this).parent('.ec-newsRole__newsItem');
  14.                 $newsDescription = $newsItem.children('.ec-newsRole__newsDescription');
  15.                 if ($newsDescription.css('display') == 'none') {
  16.                     $newsItem.addClass('is_active');
  17.                     $newsDescription.slideDown(300);
  18.                 } else {
  19.                     $newsItem.removeClass('is_active');
  20.                     $newsDescription.slideUp(300);
  21.                 }
  22.                 return false;
  23.             });
  24.         });
  25.     </script>
  26. {% endblock %}
  27. <div class="ec-role">
  28.     <div class="ec-newsRole">
  29.         <div class="ec-secHeading">
  30.             <span class="ec-secHeading__text">{{ 'お知らせ'|trans }}</span>
  31.         </div>
  32.         <div class="ec-newsRole__news">
  33.             {% for News in NewsList %}
  34.                 <div class="ec-newsRole__newsItem">
  35.                     <div class="ec-newsRole__newsHeading">
  36.                         <div class="ec-newsRole__newsDate">
  37.                             {{ News.publish_date|date_day }}
  38.                         </div>
  39.                         <div class="ec-newsRole__newsColumn">
  40.                             <div class="ec-newsRole__newsTitle{% if News.isRedTitle %} is-red{% endif %}">
  41.                                 {{ News.title }}
  42.                             </div>
  43.                             {% if News.description or News.url %}
  44.                                 <div class="ec-newsRole__newsClose">
  45.                                     <a class="ec-newsRole__newsCloseBtn">
  46.                                         <i class="fas fa-angle-down"></i>
  47.                                     </a>
  48.                                 </div>
  49.                             {% endif %}
  50.                         </div>
  51.                     </div>
  52.                     <div class="ec-newsRole__newsDescription">
  53.                         {{ News.description|raw|nl2br }}
  54.                         {% if News.url %}
  55.                             <br>
  56.                             <a href="{{ News.url }}" {% if News.link_method == '1' %}target="_blank"{% endif %}>{{ '詳しくはこちら'|trans }}</a>
  57.                         {% endif %}
  58.                     </div>
  59.                 </div>
  60.             {% endfor %}
  61.         </div>
  62.     </div>
  63. </div>