SARBase/templates/list_sar.html

60 lines
2.0 KiB
HTML
Raw Normal View History

2023-11-01 18:46:27 +00:00
{% 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>
2023-10-30 14:48:00 +00:00
<tr>
2023-11-01 18:46:27 +00:00
<th>Id</th>
<th>Title</th>
2023-10-30 14:48:00 +00:00
<th>Start Date</th>
<th>Finish Date</th>
<th>Category</th>
<th>Latitude</th>
<th>Longitude</th>
<th>Created by</th>
2023-10-30 14:48:00 +00:00
<th>Actions</th>
</tr>
2023-11-01 18:46:27 +00:00
</thead>
<tbody>
2023-10-30 14:48:00 +00:00
{% 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.SARCall.start_date }}</td>
<td>{{ sar.SARCall.finish_date }}</td>
<td>{{ sar.SARCategory.name }}</td>
<td>{{ sar.SARCall.latitude }}</td>
<td>{{ sar.SARCall.longitude }}</td>
<td>{{ sar.User.full_name }}</td>
2023-11-01 18:46:27 +00:00
<td>
<a href="{{ url_for('edit_sar', id=sar.SARCall.id) }}">
2023-11-01 18:46:27 +00:00
<button type="button" class="btn btn-info">Edit</button>
</a> |
<a href="{{ url_for('delete_sar', id=sar.SARCall.id) }}">
2023-11-01 18:46:27 +00:00
<button type="button" class="btn btn-danger">Delete</button>
</a>
</td>
</tr>
2023-10-30 14:48:00 +00:00
{% endfor %}
2023-11-01 18:46:27 +00:00
</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>
2023-11-01 18:46:27 +00:00
{% endblock %}