Add prefetch to links

This commit is contained in:
Peter Stockings
2024-12-24 01:12:27 +11:00
parent 4df28eaf2f
commit 7c3499d07a
2 changed files with 4 additions and 4 deletions

View File

@@ -15,8 +15,8 @@
<a href="/" class="text-2xl font-bold">BP Tracker</a>
<div>
{% if current_user.is_authenticated %}
<a href="{{ url_for('main.dashboard') }}" class="px-4 py-2 hover:underline">Dashboard</a>
<a href="{{ url_for('user.profile') }}" class="px-4 py-2 hover:underline">Profile</a>
<a rel="prefetch" href="{{ url_for('main.dashboard') }}" class="px-4 py-2 hover:underline">Dashboard</a>
<a rel="prefetch" href="{{ url_for('user.profile') }}" class="px-4 py-2 hover:underline">Profile</a>
<a href="{{ url_for('auth.logout') }}" class="px-4 py-2 bg-red-500 rounded hover:bg-red-600">Logout</a>
{% else %}
<a href="{{ url_for('auth.login') }}" class="px-4 py-2 hover:underline">Login</a>

View File

@@ -5,7 +5,7 @@
<!-- Header Section with "Add New Reading" Button -->
<div class="flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">Dashboard</h1>
<a href="{{ url_for('main.add_reading') }}"
<a rel="prefetch" href="{{ url_for('main.add_reading') }}"
class="bg-blue-600 text-white px-4 py-2 rounded shadow hover:bg-blue-700">
+ Add New Reading
</a>
@@ -82,7 +82,7 @@
<td class="p-2">{{ reading.diastolic }}</td>
<td class="p-2">{{ reading.heart_rate }}</td>
<td class="p-2">
<a href="{{ url_for('main.edit_reading', reading_id=reading.id) }}"
<a rel="prefetch" href="{{ url_for('main.edit_reading', reading_id=reading.id) }}"
class="text-blue-600 hover:underline">Edit</a>
<form method="POST" action="{{ url_for('main.delete_reading', reading_id=reading.id) }}"
class="inline">