diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index c1a2802..e2cd584 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 8462839..7b85a88 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/templates/base.html b/core/templates/base.html index 43113d2..1e0e226 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -38,6 +38,16 @@ overflow-x: hidden; } + /* Remove blue underline from links */ + a { + text-decoration: none !important; + color: inherit; + } + + a:hover { + color: var(--pulse-red); + } + @keyframes blink { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.1); } @@ -63,13 +73,14 @@ #sidebar { width: var(--sidebar-width); background: var(--sidebar-bg); - min-height: 100vh; + height: 100vh; position: fixed; left: 0; top: 0; z-index: 1000; border-right: 1px solid var(--border-color); transition: all 0.3s; + overflow-y: auto; } #sidebar.collapsed { diff --git a/core/templates/core/donation_history.html b/core/templates/core/donation_history.html new file mode 100644 index 0000000..a1030ca --- /dev/null +++ b/core/templates/core/donation_history.html @@ -0,0 +1,116 @@ +{% extends 'core/base.html' %} +{% load static %} + +{% block content %} +
+
+
+

{{ title }}

+

A transparent record of every life saved through the community's generosity.

+
+
+
+ Total Impact + {{ donations.count }} Donations +
+
+
+ +
+
+
+
+
Detailed Logs
+
+
+ Showing all completed events +
+
+
+
+
+ + + + + + + + + + + + + {% for donation in donations %} + + + + + + + + + {% empty %} + + + + {% endfor %} + +
DonorBlood GroupRecipient/PatientLocationDateStatus
+
+
+ +
+
+
{{ donation.donor_user.username }}
+
Verified Hero
+
+
+
+ {{ donation.request.blood_group }} + +
{{ donation.request.patient_name }}
+
+
+ {{ donation.request.hospital }} +
+
{{ donation.request.location }}
+
+
{{ donation.date|date:"M d, Y" }}
+
{{ donation.date|time:"H:i" }}
+
+ + Completed + +
+
+ +
+
No donation history available yet.
+

When donations are completed, they will appear here.

+
+
+
+
+ +
+ + Back to Dashboard + +
+
+ + +{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 81ed0ce..91940a3 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -106,6 +106,28 @@ background: var(--pulse-red); border-color: var(--pulse-red); } + + /* Scrollable Request Feed */ + .request-feed { + max-height: 500px; + overflow-y: auto; + padding-right: 10px; + scrollbar-width: thin; + scrollbar-color: rgba(230, 57, 70, 0.3) transparent; + } + .request-feed::-webkit-scrollbar { + width: 5px; + } + .request-feed::-webkit-scrollbar-track { + background: transparent; + } + .request-feed::-webkit-scrollbar-thumb { + background: rgba(230, 57, 70, 0.2); + border-radius: 10px; + } + .request-feed::-webkit-scrollbar-thumb:hover { + background: var(--pulse-red); + } {% endblock %} @@ -176,22 +198,22 @@
-
+
{{ stats.completed_donations }}
{% trans "Donations" %}
-
+
-
+
{{ stats.lives_saved }}
{% trans "Lives Saved" %}
-
+
@@ -298,7 +320,7 @@
-
+

Vaccination & Eligibility

@@ -319,6 +341,23 @@
+ + +
+

{% trans "Top 5 Myths vs. Facts about Blood Donation" %}

+
+ {% for item in myths_vs_facts %} +
+
+
{% trans "MYTH" %}
+

"{{ item.myth }}"

+
{% trans "FACT" %}
+

{{ item.fact }}

+
+
+ {% endfor %} +
+
@@ -404,27 +443,6 @@
- - -
-
-
-

{% trans "Top 5 Myths vs. Facts about Blood Donation" %}

-
- {% for item in myths_vs_facts %} -
-
-
{% trans "MYTH" %}
-

"{{ item.myth }}"

-
{% trans "FACT" %}
-

{{ item.fact }}

-
-
- {% endfor %} -
-
-
-
{% endblock %} diff --git a/core/urls.py b/core/urls.py index ae63029..3cb4ff1 100644 --- a/core/urls.py +++ b/core/urls.py @@ -39,4 +39,5 @@ urlpatterns = [ path("hospitals/", views.hospital_list, name="hospital_list"), path("update-location/", views.update_location, name="update_location"), path("emergency-sms/", views.emergency_sms, name="emergency_sms"), + path("donation-history/", views.donation_history, name="donation_history"), ] diff --git a/core/views.py b/core/views.py index a5a995e..736ba8a 100644 --- a/core/views.py +++ b/core/views.py @@ -478,6 +478,17 @@ def request_blood(request): } return render(request, 'core/request_blood.html', context) +@login_required +def donation_history(request): + """View to display the full history of completed donations.""" + completed_donations = DonationEvent.objects.filter(is_completed=True).select_related('donor_user', 'request').order_by('-date') + + context = { + 'donations': completed_donations, + 'title': 'Donation History & Lives Saved' + } + return render(request, 'core/donation_history.html', context) + @login_required @login_required def vaccination_dashboard(request):