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

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% set title = 'お知らせ' %}
  3. {% set body_class = 'news_list_page' %}
  4. {% block stylesheet %}
  5.   <link rel="stylesheet" href="{{ asset('assets/css/news-list.css') }}">
  6. {% endblock %}
  7. {% block main %}
  8.   <!-- breadcrumb section -->
  9.   <div class="breadcrumb-section">
  10.     <div class="container-1360 border-box px-40">
  11.       <nav class="breadcrumb">
  12.         <a href="{{ url('homepage') }}" class="breadcrumb__item text-black">ホーム</a>
  13.         <img src="{{ asset('assets/img/default/icons/icon-breadcrumb-arrow.svg') }}" alt=">" class="breadcrumb__separator">
  14.         <a href="{{ url('news_list') }}" class="breadcrumb__item text-black">お知らせ</a>
  15.       </nav>
  16.     </div>
  17.   </div>
  18.   <!-- news-list section -->
  19.   <div class="container-1200">
  20.     <div class="news-list-wrapper">
  21.       <!-- News-list Title Section -->
  22.       <div class="top-header-title-section">
  23.         <div class="top-header-icon-text">
  24.           <div class="top-header-icon-text">
  25.             <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  26.               <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"/>
  27.             </svg>
  28.             <span class="top-header-text">お知らせ</span>
  29.           </div>
  30.         </div>
  31.         <h1 class="top-header-title">NEWS</h1>
  32.       </div>
  33.     </div>
  34.   </div>
  35.   <div class="container-1200 container-1200-desktop">
  36.     <div class="news-list-content-section-wrapper">
  37.       <!-- news-list content section -->
  38.       <div>
  39.         <div class="news-list-content-section">
  40.           <!-- News List -->
  41.           <div id="news-list-id" class="news-list">
  42.             {% if pagination|length > 0 %}
  43.               {% for News in pagination %}
  44.                 <a href="{{ url('news_detail', {id: News.id}) }}" class="news-item">
  45.                   <div class="news-date container-desktop">{{ News.publishDate|date('Y.m.d') }}</div>
  46.                   <div class="news-title container-desktop text-black">
  47.                     <span class="text-black">{{ News.title }}</span>
  48.                   </div>
  49.                   <div class="news-wrapper-mobile container-mobile">
  50.                     <div class="news-date news-date-mobile">{{ News.publishDate|date('Y.m.d') }}</div>
  51.                     <div class="news-title news-title-mobile text-black">
  52.                       <span class="text-black">{{ News.title }}</span>
  53.                     </div>
  54.                   </div>
  55.                   <div class="news-arrow">
  56.                     <img src="{{ asset('assets/img/default/icons/icon-arrow-gray.svg') }}" alt="Arrow">
  57.                   </div>
  58.                 </a>
  59.               {% endfor %}
  60.             {% else %}
  61.               <p class="no-news">お知らせはありません。</p>
  62.             {% endif %}
  63.           </div>
  64.         </div>
  65.         <!-- Pagination -->
  66.         {% if pagination.paginationData.pageCount > 1 %}
  67.           {% set pages = pagination.paginationData %}
  68.           <div class="pagination-news-list mt-50">
  69.             <div class="pagination-product-list" style="margin: 0 auto;">
  70.               <!-- Previous Button -->
  71.               <div class="pagination-btn-group">
  72.                 {# First page button (double arrow) #}
  73.                 {% if pages.current > 1 %}
  74.                   <a class="pagination-btn pagination-btn--prev" href="{{ path('news_list') }}" aria-label="First">
  75.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  76.                       <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"/>
  77.                       <rect width="1.91077" height="11.043" transform="matrix(-1 0 0 1 4.89648 2.47656)" fill="#00A854"/>
  78.                     </svg>
  79.                   </a>
  80.                 {% else %}
  81.                   <span class="pagination-btn pagination-btn--prev is-disabled" aria-hidden="true">
  82.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  83.                       <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"/>
  84.                       <rect width="1.91077" height="11.043" transform="matrix(-1 0 0 1 4.89648 2.47656)" fill="#00A854"/>
  85.                     </svg>
  86.                   </span>
  87.                 {% endif %}
  88.                 {# Previous page button (single arrow) #}
  89.                 {% if pages.previous is defined %}
  90.                   {% set prevUrl = pages.previous == 1 ? path('news_list') : path('news_list_page', {'pageno': pages.previous}) %}
  91.                   <a class="pagination-btn pagination-btn--prev" href="{{ prevUrl }}" aria-label="Previous">
  92.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  93.                       <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"/>
  94.                     </svg>
  95.                   </a>
  96.                 {% else %}
  97.                   <span class="pagination-btn pagination-btn--prev is-disabled" aria-hidden="true">
  98.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  99.                       <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"/>
  100.                     </svg>
  101.                   </span>
  102.                 {% endif %}
  103.               </div>
  104.               <!-- Page Numbers -->
  105.               <div class="pagination-numbers container-desktop-flex">
  106.                 {% for page in pages.pagesInRange %}
  107.                   {% if page == pages.current %}
  108.                     <span class="pagination-number pagination-number--active">{{ page }}</span>
  109.                   {% else %}
  110.                     {% set pageUrl = page == 1 ? path('news_list') : path('news_list_page', {'pageno': page}) %}
  111.                     <a class="pagination-number" href="{{ pageUrl }}">{{ page }}</a>
  112.                   {% endif %}
  113.                 {% endfor %}
  114.               </div>
  115.               <div class="pagination-page-number container-mobile">
  116.                 {{ pages.current }}/{{ pages.pageCount }}
  117.               </div>
  118.               <!-- Next Button -->
  119.               <div class="pagination-btn-group">
  120.                 {# Next page button (single arrow) #}
  121.                 {% if pages.next is defined %}
  122.                   <a class="pagination-btn pagination-btn--next" href="{{ path('news_list_page', {'pageno': pages.next}) }}" aria-label="Next">
  123.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  124.                       <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"/>
  125.                     </svg>
  126.                   </a>
  127.                 {% else %}
  128.                   <span class="pagination-btn pagination-btn--next is-disabled" aria-hidden="true">
  129.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  130.                       <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"/>
  131.                     </svg>
  132.                   </span>
  133.                 {% endif %}
  134.                 {# Last page button (double arrow) #}
  135.                 {% if pages.current < pages.pageCount %}
  136.                   <a class="pagination-btn pagination-btn--next" href="{{ path('news_list_page', {'pageno': pages.pageCount}) }}" aria-label="Last">
  137.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  138.                       <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"/>
  139.                       <rect x="11.1035" y="2.47656" width="1.91077" height="11.043" fill="#00A854"/>
  140.                     </svg>
  141.                   </a>
  142.                 {% else %}
  143.                   <span class="pagination-btn pagination-btn--next is-disabled" aria-hidden="true">
  144.                     <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  145.                       <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"/>
  146.                       <rect x="11.1035" y="2.47656" width="1.91077" height="11.043" fill="#00A854"/>
  147.                     </svg>
  148.                   </span>
  149.                 {% endif %}
  150.               </div>
  151.             </div>
  152.           </div>
  153.         {% endif %}
  154.       </div>
  155.     </div>
  156.   </div>
  157. {% endblock %}