{% extends 'frontend/base.html.twig' %}
{% block body %}
<div class="page-bar-hero is-detail" style="margin-top:75px;">
<div class="container d-flex align-items-center">
<div class="position-relative">
<a href="{{ path('homepage') }}" class="btn btn-outline-light btn-sm fw-500 mb-3">
<i class="bi bi-arrow-left-circle"></i>
Beranda
</a>
<div class="title-infografik">Daftar Rilis Publikasi</div>
</div>
</div>
</div>
<main>
<div class="pt-4 pb-5">
<div class="container">
<div class="row">
<div class="col-xl-12 col-lg-12">
<div class="card shadow" style="margin-left: 10%; margin-right: 10%;">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Daftar Publikasi 2024</h6>
</div>
<!-- Card Body -->
<div class="card-body">
{% if button_credential[page_name]['new'] is defined %}
<a href="{{ path(page_name ~ '_new') }}" class="btn btn-xs btn-success"><i class="fa fa-plus"></i> {{'new'|trans}}</a>
{% endif %}
<div class="conditional-responsive-table">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>{{ 'no'|title }}</th>
<th>{{ 'Judul Publikasi'|title }}</th>
<th>{{ 'Sumber Data'|title }}</th>
<th>{{ 'Jadwal Rilis'|title }}</th>
<th>{{ 'Status'|title }}</th>
<th>{{ 'Aksi'|title }}</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="6" style="text-align: center; vertical-align: middle;">Data publikasi belum ada</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row pt-5">
<div class="col-xl-12 col-lg-12">
<div class="card shadow" style="margin-left: 10%; margin-right: 10%;">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Daftar Publikasi 2023</h6>
</div>
<!-- Card Body -->
<div class="card-body">
{% if button_credential[page_name]['new'] is defined %}
<a href="{{ path(page_name ~ '_new') }}" class="btn btn-xs btn-success"><i class="fa fa-plus"></i> {{'new'|trans}}</a>
{% endif %}
<div class="conditional-responsive-table">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>{{ 'no'|title }}</th>
<th>{{ 'Judul Publikasi'|title }}</th>
<th>{{ 'Sumber Data'|title }}</th>
<th>{{ 'Jadwal Rilis'|title }}</th>
<th>{{ 'Status'|title }}</th>
<th>{{ 'Aksi'|title }}</th>
</tr>
{# {% include 'frontend/' ~page_name ~ '/_filters.html.twig' %} #}
</thead>
<tbody>
{% for i, data in pagination %}
<tr>
<td>{{ i + ( pagination.getItemNumberPerPage * pagination.getCurrentPageNumber ) - pagination.getItemNumberPerPage + 1 }}</td>
<td ><a href="{{ path('detail_publikasii', {id: data.id}) }}">{{ data.judul }}</a></td>
<td>{{ data.sumber }}</td>
<td>{{ data.releaseDate | date("d F Y") }}</td>
<td>
{% set now = "now" | date("Y-m-d") %}
{% set releaseDate = data.releaseDate | date("Y-m-d") %}
{% if releaseDate <= now %}
<span class="badge badge-success">Sudah Rilis</span>
{% else %}
<span class="badge badge-warning">Belum Rilis</span>
{% endif %}
</td>
<td><a href="{{ path('detail_publikasii', {id: data.id}) }}" ><i class="fa fa-eye mr-1"></i></a></td>
</tr>
{% else %}
<tr>
<td colspan="9">{{ 'record_not_found'|trans }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<script>
document.addEventListener("DOMContentLoaded", function() {
function updateTableResponsiveClass() {
const tables = document.querySelectorAll('.conditional-responsive-table');
tables.forEach(table => {
if (window.innerWidth < 992) {
table.classList.add('table-responsive');
} else {
table.classList.remove('table-responsive');
}
});
}
// Initial check
updateTableResponsiveClass();
// Update on resize
window.addEventListener('resize', updateTableResponsiveClass);
});
</script>
{% endblock %}