Add page to confirm deletion and add cancel button on edit page

This commit is contained in:
Peter Stockings
2024-12-24 23:24:15 +11:00
parent c160f9d214
commit f3c778048f
4 changed files with 91 additions and 19 deletions

View File

@@ -0,0 +1,28 @@
{% extends "_layout.html" %}
{% block content %}
<div class="max-w-lg mx-auto bg-white p-6 rounded-lg shadow-md mt-10">
<h2 class="text-lg font-bold text-gray-800">Confirm Deletion</h2>
<p class="text-sm text-gray-600 mt-2">Are you sure you want to delete the following reading?</p>
<!-- Reading Details -->
<div class="mt-4 p-4 bg-gray-100 rounded">
<p><strong>Timestamp:</strong> {{ reading.timestamp.strftime('%d %b %Y, %I:%M %p') }}</p>
<p><strong>Systolic:</strong> {{ reading.systolic }} mmHg</p>
<p><strong>Diastolic:</strong> {{ reading.diastolic }} mmHg</p>
<p><strong>Heart Rate:</strong> {{ reading.heart_rate }} bpm</p>
</div>
<!-- Confirmation Buttons -->
<div class="mt-6 flex justify-end space-x-2">
<a href="{{ url_for('main.dashboard') }}" class="px-4 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400">
Cancel
</a>
<form method="POST" action="{{ url_for('main.confirm_delete', reading_id=reading.id) }}">
<button type="submit" class="px-4 py-2 bg-red-600 text-white rounded hover:bg-red-700">
Confirm
</button>
</form>
</div>
</div>
{% endblock %}