Refactor routes.py
This commit is contained in:
@@ -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 rel="prefetch" href="{{ url_for('main.add_reading') }}"
|
||||
<a rel="prefetch" href="{{ url_for('reading.add_reading') }}"
|
||||
class="bg-blue-600 text-white px-4 py-2 rounded shadow hover:bg-blue-700">
|
||||
+ Add New Reading
|
||||
</a>
|
||||
@@ -98,7 +98,7 @@
|
||||
<!-- List -->
|
||||
<div x-show="activeView === 'list'" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{% for reading in readings %}
|
||||
<a href="{{ url_for('main.edit_reading', reading_id=reading.id) }}"
|
||||
<a href="{{ url_for('reading.edit_reading', reading_id=reading.id) }}"
|
||||
class="bg-white shadow-md rounded-lg p-4 flex flex-col justify-between relative hover:shadow-lg transition-shadow">
|
||||
<!-- Timestamp -->
|
||||
<div class="absolute top-2 right-2 flex items-center text-gray-400 text-xs">
|
||||
@@ -155,7 +155,7 @@
|
||||
<div class="text-sm font-bold text-gray-500">{{ day.strftime('%a, %b %d') }}</div>
|
||||
{% if day in readings_by_date %}
|
||||
{% for reading in readings_by_date[day]|sort(attribute="timestamp", reverse = True) %}
|
||||
<a href="{{ url_for('main.edit_reading', reading_id=reading.id) }}"
|
||||
<a href="{{ url_for('reading.edit_reading', reading_id=reading.id) }}"
|
||||
class="block mt-2 p-0 md:p-2 bg-green-100 rounded-lg shadow hover:bg-green-200 transition">
|
||||
<p class="text-xs font-medium text-green-800">
|
||||
{{ reading.systolic }}/{{ reading.diastolic }} mmHg
|
||||
@@ -223,7 +223,7 @@
|
||||
<span class="text-gray-500 font-semibold">{{ day.day }}</span>
|
||||
</div>
|
||||
{% for reading in day.readings %}
|
||||
<a href="{{ url_for('main.edit_reading', reading_id=reading.id) }}"
|
||||
<a href="{{ url_for('reading.edit_reading', reading_id=reading.id) }}"
|
||||
class="block mt-2 p-0 md:p-2 bg-green-100 rounded-lg shadow hover:bg-green-200 transition">
|
||||
<p class="text-xs font-medium text-green-800">
|
||||
{{ reading.systolic }}/{{ reading.diastolic }} mmHg
|
||||
|
||||
Reference in New Issue
Block a user