resolution-archive/templates/resulation/viewresulation.html
2025-01-30 13:07:48 +06:00

79 lines
2.3 KiB
HTML

{% extends "base.html" %}
{% block content %}
{% load static %}
<div class="table-container">
<div class="table-header">
<h2>PDF Records</h2>
<input type="text" id="searchInput" class="search-box" placeholder="Search records...">
</div>
{% if pdf_records %}
<table class="records-table" aria-label="PDF Records">
<thead>
<tr>
<th>ID</th>
<th>Type</th>
<th>Organization</th>
<th>Topic</th>
<th>Title</th>
<th>Meeting Number</th>
<th>Meeting Date</th>
<th>Venue</th>
<th>Attendance</th>
<th>Resolution</th>
</tr>
</thead>
<tbody>
{% for record in pdf_records %}
<tr>
<td>{{ record.eid }}</td>
<td>{{ record.pdftype }}</td>
<td>{{ record.org_unit }}</td>
<td>{{ record.topic }}</td>
<td>{{ record.tittle }}</td>
<td>{{ record.m_number }}</td>
<td>{{ record.m_date|date:"d M Y" }}</td>
<td>{{ record.m_venue }}</td>
<td>
<a href="{{ record.attendance_file.url }}">Download</a>
</td>
<td>
{% if record.res_con_mou_file %}
<a href="{{ record.res_con_mou_file.url }}">Download</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No records found.</p>
{% endif %}
</div>
<script>
document.getElementById('searchInput').addEventListener('input', function() {
const searchTerm = this.value.toLowerCase();
const rows = document.querySelectorAll('tr');
rows.forEach((row, index) => {
// Skip the header row
if (index === 0) {
return;
}
const cells = row.cells;
let match = false;
for (let i = 0; i < cells.length; i++) {
if (cells[i].textContent.toLowerCase().includes(searchTerm)) {
match = true;
break;
}
}
row.style.display = match ? 'table-row' : 'none';
});
});
</script>
{% endblock content %}