SARBase/templates/list_sar.html

65 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block title %}
SAR Records
{% endblock %}
{% block content %}
<div class="container mt-5">
<h2>SAR Records</h2>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Id</th>
<th>Title</th>
<th>Status</th>
<th>Start Date</th>
<th>Finish Date</th>
<th>Category</th>
<th>Created by</th>
<th>Manager</th>
{% if is_logged_in %}
<th>Actions</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for sar in sar_calls %}
<tr class="clickable-row" data-href="{{ url_for('sar_details', id=sar.SARCall.id) }}">
<td>{{ sar.SARCall.id }}</td>
<td>{{ sar.SARCall.title }}</td>
<td>{{ sar.SARStatus.name }}</td>
<td>{{ sar.SARCall.start_date }}</td>
<td>{{ sar.SARCall.finish_date }}</td>
<td>{{ sar.SARCategory.name }}</td>
<td>{{ sar.SARCall.coordination_officer.full_name }}</td>
<td>{{ sar.SARCall.search_officer.full_name }}</td>
{% if is_logged_in %}
<td>
<a href="{{ url_for('edit_sar', id=sar.SARCall.id) }}">
<button type="button" class="btn btn-info">Edit</button>
</a>
{# <a href="{{ url_for('delete_sar', id=sar.SARCall.id) }}">#}
{# <button type="button" class="btn btn-danger">Delete</button>#}
{# </a>#}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{# <a href="/dashboard">Back to Dashboard</a>#}
</div>
<script>
document.querySelectorAll('.clickable-row').forEach(row => {
row.addEventListener('click', () => {
window.location.href = row.dataset.href;
});
});
</script>
{% endblock %}