resolution-archive/templates/resulation/viewcontract.html

88 lines
2.9 KiB
HTML
Raw Permalink Normal View History

2025-02-18 16:23:22 +06:00
{% extends "base.html" %}
{% block content %}
{% load static %}
<div class="table-container">
<div class="table-header">
<h2>Contracts</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>Topic</th>
<th>First Party</th>
<th>Second Party</th>
<th>Contract Signing Date</th>
<th>Contract End Date</th>
<th>Duration Of Contract</th>
<th>Contract</th>
</tr>
</thead>
<tbody>
{% for record in pdf_records %}
<tr>
<td>{{ record.eid }}</td>
2025-02-18 17:04:07 +06:00
<td>{{ record.pdftype }}</td>
2025-02-18 16:23:22 +06:00
<td>{{ record.topic }}</td>
<td>{{ record.first_party }}</td>
<td>{{ record.second_party }}</td>
<td>{{ record.contract_mou_date|date:"d M Y" }}</td>
<td>{{ record.closing_date|date:"d M Y" }}</td>
2025-02-27 15:58:42 +06:00
<td>{{ record.duration}}</td>
2025-02-18 16:23:22 +06:00
<td>
{% if record.res_con_mou_file %}
<a href="{% url 'file-download' type="resolution" filename=record.res_con_mou_file %}">Download</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
2025-02-27 15:58:42 +06:00
<!-- Pagination -->
<div class="pagination">
<div class="page-links">
{% if pdf_records.has_previous %}
<a href="?page={{ pdf_records.previous_page_number }}" class="prev">Previous</a>
{% endif %}
<span class="current-page">{{ pdf_records.number }}</span>
<span class="total-pages">/ {{ pdf_records.paginator.num_pages }}</span>
{% if pdf_records.has_next %}
<a href="?page={{ pdf_records.next_page_number }}" class="next">Next</a>
{% endif %}
</div>
</div>
{% else %}
2025-02-18 16:23:22 +06:00
<p>No records found.</p>
2025-02-27 15:58:42 +06:00
{% endif %}
2025-02-18 16:23:22 +06:00
</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 %}