Autosave: 20260227-140517
This commit is contained in:
parent
34ef272e25
commit
78b19857c0
Binary file not shown.
Binary file not shown.
@ -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 {
|
||||
|
||||
116
core/templates/core/donation_history.html
Normal file
116
core/templates/core/donation_history.html
Normal file
@ -0,0 +1,116 @@
|
||||
{% extends 'core/base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-5">
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-8">
|
||||
<h2 class="display-5 fw-bold text-dark mb-2">{{ title }}</h2>
|
||||
<p class="text-muted">A transparent record of every life saved through the community's generosity.</p>
|
||||
</div>
|
||||
<div class="col-md-4 text-md-end d-flex align-items-center justify-content-md-end">
|
||||
<div class="stats-badge p-3 bg-white rounded shadow-sm border-start border-4 border-danger">
|
||||
<span class="d-block text-muted small text-uppercase fw-bold">Total Impact</span>
|
||||
<span class="h4 fw-bold mb-0 text-danger">{{ donations.count }} Donations</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-0 shadow-sm rounded-4 overflow-hidden">
|
||||
<div class="card-header bg-white py-3 border-bottom border-light">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h5 class="mb-0 fw-bold">Detailed Logs</h5>
|
||||
</div>
|
||||
<div class="col-auto text-muted small">
|
||||
<i class="fas fa-info-circle me-1"></i> Showing all completed events
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead class="bg-light text-muted small text-uppercase">
|
||||
<tr>
|
||||
<th class="ps-4 border-0 py-3">Donor</th>
|
||||
<th class="border-0 py-3">Blood Group</th>
|
||||
<th class="border-0 py-3">Recipient/Patient</th>
|
||||
<th class="border-0 py-3">Location</th>
|
||||
<th class="border-0 py-3">Date</th>
|
||||
<th class="pe-4 border-0 py-3 text-end">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for donation in donations %}
|
||||
<tr>
|
||||
<td class="ps-4">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="avatar-sm rounded-circle bg-danger bg-opacity-10 text-danger d-flex align-items-center justify-content-center me-3" style="width: 40px; height: 40px;">
|
||||
<i class="fas fa-user"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="fw-bold">{{ donation.donor_user.username }}</div>
|
||||
<div class="text-muted small">Verified Hero</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-danger rounded-pill">{{ donation.request.blood_group }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="fw-medium text-dark">{{ donation.request.patient_name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="text-muted">
|
||||
<i class="fas fa-hospital-alt me-1 small"></i> {{ donation.request.hospital }}
|
||||
</div>
|
||||
<div class="small text-muted opacity-75">{{ donation.request.location }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="fw-medium text-dark">{{ donation.date|date:"M d, Y" }}</div>
|
||||
<div class="small text-muted">{{ donation.date|time:"H:i" }}</div>
|
||||
</td>
|
||||
<td class="pe-4 text-end">
|
||||
<span class="badge bg-success bg-opacity-10 text-success px-3 py-2 rounded-pill">
|
||||
<i class="fas fa-check-circle me-1"></i> Completed
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-5 text-muted">
|
||||
<div class="mb-3">
|
||||
<i class="fas fa-history fa-3x opacity-25"></i>
|
||||
</div>
|
||||
<h5>No donation history available yet.</h5>
|
||||
<p class="mb-0">When donations are completed, they will appear here.</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 text-center">
|
||||
<a href="{% url 'home' %}" class="btn btn-outline-secondary rounded-pill px-4">
|
||||
<i class="fas fa-arrow-left me-2"></i> Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.avatar-sm {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.table th {
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
.table td {
|
||||
padding-top: 1.25rem;
|
||||
padding-bottom: 1.25rem;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@ -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);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
@ -176,22 +198,22 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xl-2 col-md-4 col-6">
|
||||
<div class="stat-card">
|
||||
<a href="{% url 'donation_history' %}" class="stat-card">
|
||||
<div class="icon-box bg-success bg-opacity-10 text-success">
|
||||
<i class="bi bi-check2-circle"></i>
|
||||
</div>
|
||||
<div class="stat-value">{{ stats.completed_donations }}</div>
|
||||
<div class="stat-label">{% trans "Donations" %}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xl-3 col-md-6 col-6">
|
||||
<div class="stat-card bg-danger bg-opacity-10 border-danger">
|
||||
<a href="{% url 'donation_history' %}" class="stat-card bg-danger bg-opacity-10 border-danger">
|
||||
<div class="icon-box bg-danger text-white">
|
||||
<i class="bi bi-heart-fill"></i>
|
||||
</div>
|
||||
<div class="stat-value text-danger">{{ stats.lives_saved }}</div>
|
||||
<div class="stat-label text-danger">{% trans "Lives Saved" %}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xl-3 col-md-6 col-12">
|
||||
<div class="stat-card">
|
||||
@ -298,7 +320,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Vaccination Monitoring Section -->
|
||||
<div class="vaccination-card">
|
||||
<div class="vaccination-card mb-4">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-7">
|
||||
<h4 class="brand-font text-white mb-2">Vaccination & Eligibility</h4>
|
||||
@ -319,6 +341,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Myths vs Facts Section -->
|
||||
<div class="glass-card bg-light bg-opacity-10 border-danger mb-4">
|
||||
<h4 class="brand-font mb-4 text-center"><i class="bi bi-question-diamond text-danger me-2"></i>{% trans "Top 5 Myths vs. Facts about Blood Donation" %}</h4>
|
||||
<div class="row g-3">
|
||||
{% for item in myths_vs_facts %}
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="myth-fact-card p-3 h-100 bg-white rounded-4 shadow-sm border-bottom border-danger border-3">
|
||||
<div class="text-danger small fw-bold mb-2">{% trans "MYTH" %}</div>
|
||||
<p class="small text-muted mb-3 italic">"{{ item.myth }}"</p>
|
||||
<div class="text-success small fw-bold mb-1">{% trans "FACT" %}</div>
|
||||
<p class="extra-small text-dark mb-0">{{ item.fact }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar Components -->
|
||||
@ -404,27 +443,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Myths vs Facts Section -->
|
||||
<div class="row g-4 mt-2 mb-5">
|
||||
<div class="col-12">
|
||||
<div class="glass-card bg-light bg-opacity-10 border-danger">
|
||||
<h4 class="brand-font mb-4 text-center"><i class="bi bi-question-diamond text-danger me-2"></i>{% trans "Top 5 Myths vs. Facts about Blood Donation" %}</h4>
|
||||
<div class="row g-4">
|
||||
{% for item in myths_vs_facts %}
|
||||
<div class="col-md-4 col-lg-2 {% if forloop.first %}offset-lg-1{% endif %}">
|
||||
<div class="myth-fact-card p-3 h-100 bg-white rounded-4 shadow-sm border-bottom border-danger border-3">
|
||||
<div class="text-danger small fw-bold mb-2">{% trans "MYTH" %}</div>
|
||||
<p class="small text-muted mb-3 italic">"{{ item.myth }}"</p>
|
||||
<div class="text-success small fw-bold mb-1">{% trans "FACT" %}</div>
|
||||
<p class="extra-small text-dark mb-0">{{ item.fact }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@ -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"),
|
||||
]
|
||||
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user