app/template/default/News/index.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% set body_class = 'news_list_page' %}
  3. {% block stylesheet %}
  4.   <link rel="stylesheet" href="{{ asset('assets/css/news-list.css') }}">
  5. {% endblock %}
  6. {% block main %}
  7.   <!-- breadcrumb section -->
  8.   <div class="breadcrumb-section">
  9.     <div class="container-1360 border-box px-40">
  10.       <nav class="breadcrumb">
  11.         <a href="{{ url('homepage') }}" class="breadcrumb__item text-black">ホーム</a>
  12.         <img src="{{ asset('assets/img/default/icons/icon-breadcrumb-arrow.svg') }}" alt=">" class="breadcrumb__separator">
  13.         <a href="{{ url('news_list') }}" class="breadcrumb__item text-black">お知らせ</a>
  14.       </nav>
  15.     </div>
  16.   </div>
  17.   <!-- news-list section -->
  18.   <div class="container-1200">
  19.     <div class="news-list-wrapper">
  20.       <!-- News-list Title Section -->
  21.       <div class="top-header-title-section">
  22.         <div class="top-header-icon-text">
  23.           <div class="top-header-icon-text">
  24.             <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  25.               <path d="M7.08203 12.5H7.08301V17.5H5.41602V13.335H2.91504C2.45495 13.3348 2.08203 12.9611 2.08203 12.501V7.50098C2.08221 7.041 2.45506 6.66814 2.91504 6.66797H7.08203V12.5ZM17.083 8.33203H17.916V11.665H17.083V17.5H15.416V17.499L8.75293 13.335H8.75V6.66797H17.083V8.33203ZM17.083 6.66699H8.75L15.416 2.5H17.083V6.66699Z" fill="#00A854"/>
  26.             </svg>
  27.             <span class="top-header-text">お知らせ</span>
  28.           </div>
  29.         </div>
  30.         <h1 class="top-header-title">NEWS</h1>
  31.       </div>
  32.     </div>
  33.   </div>
  34.   <div class="container-1200 container-1200-desktop">
  35.     <div class="news-list-content-section-wrapper">
  36.       <!-- news-list content section -->
  37.       <div>
  38.         <div class="news-list-content-section">
  39.           <!-- News List -->
  40.           <div id="news-list-id" class="news-list">
  41.             {% if pagination|length > 0 %}
  42.               {% for News in pagination %}
  43.                 <a href="{{ url('news_detail', {id: News.id}) }}" class="news-item">
  44.                   <div class="news-date container-desktop">{{ News.publishDate|date('Y.m.d') }}</div>
  45.                   <div class="news-title container-desktop text-black">
  46.                     <span class="text-black">{{ News.title }}</span>
  47.                   </div>
  48.                   <div class="news-wrapper-mobile container-mobile">
  49.                     <div class="news-date news-date-mobile">{{ News.publishDate|date('Y.m.d') }}</div>
  50.                     <div class="news-title news-title-mobile text-black">
  51.                       <span class="text-black">{{ News.title }}</span>
  52.                     </div>
  53.                   </div>
  54.                   <div class="news-arrow">
  55.                     <img src="{{ asset('assets/img/default/icons/icon-arrow-gray.svg') }}" alt="Arrow">
  56.                   </div>
  57.                 </a>
  58.               {% endfor %}
  59.             {% else %}
  60.               <p class="no-news">お知らせはありません。</p>
  61.             {% endif %}
  62.           </div>
  63.         </div>
  64.         <!-- Pagination -->
  65.         {% if pagination.paginationData.pageCount > 1 %}
  66.           {% set pages = pagination.paginationData %}
  67.           <div class="pagination-news-list mt-50">
  68.             <div class="pagination-product-list" style="margin: 0 auto;">
  69.               <!-- Previous Button -->
  70.               <div class="pagination-btn-group">
  71.                 {# First page button (double arrow) #}
  72.                 {% if pages.current > 1 %}
  73.                   <a class="pagination-btn pagination-btn--prev" href="{{ path('news_list') }}" aria-label="First">
  74.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  75.                       <path d="M5.74659 8.0006L11.4034 13.6575L13.2891 11.7718L9.51783 8.0006L13.2891 4.22937L11.4034 2.34375L5.74659 8.0006Z" fill="#00A854"/>
  76.                       <rect width="1.91077" height="11.043" transform="matrix(-1 0 0 1 4.89648 2.47656)" fill="#00A854"/>
  77.                     </svg>
  78.                   </a>
  79.                 {% else %}
  80.                   <span class="pagination-btn pagination-btn--prev is-disabled" aria-hidden="true">
  81.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  82.                       <path d="M5.74659 8.0006L11.4034 13.6575L13.2891 11.7718L9.51783 8.0006L13.2891 4.22937L11.4034 2.34375L5.74659 8.0006Z" fill="#00A854"/>
  83.                       <rect width="1.91077" height="11.043" transform="matrix(-1 0 0 1 4.89648 2.47656)" fill="#00A854"/>
  84.                     </svg>
  85.                   </span>
  86.                 {% endif %}
  87.                 {# Previous page button (single arrow) #}
  88.                 {% if pages.previous is defined %}
  89.                   {% set prevUrl = pages.previous == 1 ? path('news_list') : path('news_list_page', {'pageno': pages.previous}) %}
  90.                   <a class="pagination-btn pagination-btn--prev" href="{{ prevUrl }}" aria-label="Previous">
  91.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  92.                       <path d="M3.44581 8.0006L9.10266 13.6575L10.9883 11.7718L7.21705 8.0006L10.9883 4.22937L9.10266 2.34375L3.44581 8.0006Z" fill="#00A854"/>
  93.                     </svg>
  94.                   </a>
  95.                 {% else %}
  96.                   <span class="pagination-btn pagination-btn--prev is-disabled" aria-hidden="true">
  97.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  98.                       <path d="M3.44581 8.0006L9.10266 13.6575L10.9883 11.7718L7.21705 8.0006L10.9883 4.22937L9.10266 2.34375L3.44581 8.0006Z" fill="#00A854"/>
  99.                     </svg>
  100.                   </span>
  101.                 {% endif %}
  102.               </div>
  103.               <!-- Page Numbers -->
  104.               <div class="pagination-numbers container-desktop-flex">
  105.                 {% for page in pages.pagesInRange %}
  106.                   {% if page == pages.current %}
  107.                     <span class="pagination-number pagination-number--active">{{ page }}</span>
  108.                   {% else %}
  109.                     {% set pageUrl = page == 1 ? path('news_list') : path('news_list_page', {'pageno': page}) %}
  110.                     <a class="pagination-number" href="{{ pageUrl }}">{{ page }}</a>
  111.                   {% endif %}
  112.                 {% endfor %}
  113.               </div>
  114.               <div class="pagination-page-number container-mobile">
  115.                 {{ pages.current }}/{{ pages.pageCount }}
  116.               </div>
  117.               <!-- Next Button -->
  118.               <div class="pagination-btn-group">
  119.                 {# Next page button (single arrow) #}
  120.                 {% if pages.next is defined %}
  121.                   <a class="pagination-btn pagination-btn--next" href="{{ path('news_list_page', {'pageno': pages.next}) }}" aria-label="Next">
  122.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  123.                       <path d="M12.5542 8.0006L6.89734 13.6575L5.01172 11.7718L8.78295 8.0006L5.01172 4.22937L6.89734 2.34375L12.5542 8.0006Z" fill="#00A854"/>
  124.                     </svg>
  125.                   </a>
  126.                 {% else %}
  127.                   <span class="pagination-btn pagination-btn--next is-disabled" aria-hidden="true">
  128.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  129.                       <path d="M12.5542 8.0006L6.89734 13.6575L5.01172 11.7718L8.78295 8.0006L5.01172 4.22937L6.89734 2.34375L12.5542 8.0006Z" fill="#00A854"/>
  130.                     </svg>
  131.                   </span>
  132.                 {% endif %}
  133.                 {# Last page button (double arrow) #}
  134.                 {% if pages.current < pages.pageCount %}
  135.                   <a class="pagination-btn pagination-btn--next" href="{{ path('news_list_page', {'pageno': pages.pageCount}) }}" aria-label="Last">
  136.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  137.                       <path d="M10.2534 8.0006L4.59656 13.6575L2.71094 11.7718L6.48217 8.0006L2.71094 4.22937L4.59656 2.34375L10.2534 8.0006Z" fill="#00A854"/>
  138.                       <rect x="11.1035" y="2.47656" width="1.91077" height="11.043" fill="#00A854"/>
  139.                     </svg>
  140.                   </a>
  141.                 {% else %}
  142.                   <span class="pagination-btn pagination-btn--next is-disabled" aria-hidden="true">
  143.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  144.                       <path d="M10.2534 8.0006L4.59656 13.6575L2.71094 11.7718L6.48217 8.0006L2.71094 4.22937L4.59656 2.34375L10.2534 8.0006Z" fill="#00A854"/>
  145.                       <rect x="11.1035" y="2.47656" width="1.91077" height="11.043" fill="#00A854"/>
  146.                     </svg>
  147.                   </span>
  148.                 {% endif %}
  149.               </div>
  150.             </div>
  151.           </div>
  152.         {% endif %}
  153.       </div>
  154.     </div>
  155.   </div>
  156. {% endblock %}