templates/frontend/list_publikasi/index.html.twig line 1

Open in your IDE?
  1. {% extends 'frontend/base.html.twig' %}
  2. {% block body %}
  3.     <div class="page-bar-hero is-detail" style="margin-top:75px;">
  4.         <div class="container d-flex align-items-center">
  5.             <div class="position-relative">
  6.                 <a href="{{ path('homepage') }}" class="btn btn-outline-light btn-sm fw-500 mb-3">
  7.                     <i class="bi bi-arrow-left-circle"></i>
  8.                     Beranda
  9.                 </a>
  10.                 <div class="title-infografik">Daftar Rilis Publikasi</div>
  11.             </div>
  12.         </div>
  13.     </div>
  14.     <main>
  15.         <div class="pt-4 pb-5">
  16.             <div class="container">
  17.                 <div class="row">
  18.                     <div class="col-xl-12 col-lg-12">
  19.                         <div class="card shadow" style="margin-left: 10%; margin-right: 10%;">
  20.                             <!-- Card Header - Dropdown -->
  21.                             <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
  22.                                 <h6 class="m-0 font-weight-bold text-primary">Daftar Publikasi 2024</h6>
  23.                             </div>
  24.                             
  25.                             <!-- Card Body -->
  26.                             <div class="card-body">
  27.                                 {% if button_credential[page_name]['new'] is defined %}
  28.                                     <a href="{{ path(page_name ~ '_new') }}" class="btn btn-xs btn-success"><i class="fa fa-plus"></i> {{'new'|trans}}</a>
  29.                                 {% endif %}
  30.     
  31.                                 <div class="conditional-responsive-table">
  32.                                     <table class="table table-bordered table-hover">
  33.                                         <thead>
  34.                                             <tr>
  35.                                                 <th>{{ 'no'|title }}</th>
  36.                                                 <th>{{ 'Judul Publikasi'|title }}</th>
  37.                                                 <th>{{ 'Sumber Data'|title }}</th>
  38.                                                 <th>{{ 'Jadwal Rilis'|title }}</th>
  39.                                                 <th>{{ 'Status'|title }}</th>
  40.                                                 <th>{{ 'Aksi'|title }}</th>
  41.                                             </tr>
  42.                                         </thead>
  43.                                         <tbody>
  44.                                             <tr>
  45.                                                 <td colspan="6" style="text-align: center; vertical-align: middle;">Data publikasi belum ada</td>
  46.                                             </tr>
  47.                                         </tbody>
  48.                                     </table>
  49.                                 </div>
  50.                             </div>
  51.                         </div>
  52.                     </div>
  53.                 </div>
  54.                 <div class="row pt-5">
  55.                     <div class="col-xl-12 col-lg-12">
  56.                         <div class="card shadow" style="margin-left: 10%; margin-right: 10%;">
  57.                             <!-- Card Header - Dropdown -->
  58.                             <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
  59.                                 <h6 class="m-0 font-weight-bold text-primary">Daftar Publikasi 2023</h6>
  60.                             </div>
  61.                             
  62.                             <!-- Card Body -->
  63.                             <div class="card-body">
  64.                                 {% if button_credential[page_name]['new'] is defined %}
  65.                                     <a href="{{ path(page_name ~ '_new') }}" class="btn btn-xs btn-success"><i class="fa fa-plus"></i> {{'new'|trans}}</a>
  66.                                 {% endif %}
  67.     
  68.                                 <div class="conditional-responsive-table">
  69.                                     <table class="table table-bordered table-hover">
  70.                                         <thead>
  71.                                             <tr>
  72.                                                 <th>{{ 'no'|title }}</th>
  73.                                                 <th>{{ 'Judul Publikasi'|title }}</th>
  74.                                                 <th>{{ 'Sumber Data'|title }}</th>
  75.                                                 <th>{{ 'Jadwal Rilis'|title }}</th>
  76.                                                 <th>{{ 'Status'|title }}</th>
  77.                                                 <th>{{ 'Aksi'|title }}</th>
  78.                                             </tr>
  79.                                             {# {% include 'frontend/' ~page_name ~ '/_filters.html.twig' %} #}
  80.                                         </thead>
  81.                                         <tbody>
  82.                                             {% for i, data in pagination %}
  83.                                                 <tr>
  84.                                                     <td>{{ i + ( pagination.getItemNumberPerPage * pagination.getCurrentPageNumber ) - pagination.getItemNumberPerPage + 1 }}</td>
  85.                                                     <td ><a href="{{ path('detail_publikasii', {id: data.id}) }}">{{ data.judul }}</a></td>
  86.                                                     <td>{{ data.sumber }}</td>
  87.                                                     <td>{{ data.releaseDate | date("d F Y") }}</td>
  88.                                                     <td>
  89.                                                         {% set now = "now" | date("Y-m-d") %}
  90.                                                         {% set releaseDate = data.releaseDate | date("Y-m-d") %}
  91.                                                         {% if releaseDate <= now %}
  92.                                                             <span class="badge badge-success">Sudah Rilis</span>
  93.                                                         {% else %}
  94.                                                             <span class="badge badge-warning">Belum Rilis</span>
  95.                                                         {% endif %}
  96.                                                     </td>
  97.                                                     <td><a href="{{ path('detail_publikasii', {id: data.id}) }}" ><i class="fa fa-eye mr-1"></i></a></td>
  98.                                                 </tr>
  99.                                                 {% else %}
  100.                                                 <tr>
  101.                                                     <td colspan="9">{{ 'record_not_found'|trans }}</td>
  102.                                                 </tr>
  103.                                             {% endfor %}
  104.                                         </tbody>
  105.                                     </table>
  106.                                 </div>
  107.     
  108.                             </div>
  109.                         </div>
  110.                     </div>
  111.                 </div>
  112.             </div>
  113.         </div>
  114.     </main>
  115.     <script>
  116.         document.addEventListener("DOMContentLoaded", function() {
  117.         function updateTableResponsiveClass() {
  118.             const tables = document.querySelectorAll('.conditional-responsive-table');
  119.             tables.forEach(table => {
  120.                 if (window.innerWidth < 992) {
  121.                     table.classList.add('table-responsive');
  122.                 } else {
  123.                     table.classList.remove('table-responsive');
  124.                 }
  125.             });
  126.         }
  127.         // Initial check
  128.         updateTableResponsiveClass();
  129.         // Update on resize
  130.         window.addEventListener('resize', updateTableResponsiveClass);
  131.     });
  132.     </script>
  133. {% endblock %}