Merge branch 'main' of https://gitea.staxriver.com/staxriver/padelclub_backend
commit
55f333013b
@ -0,0 +1,163 @@ |
||||
{% extends "admin/base_site.html" %} |
||||
{% load admin_urls %} |
||||
|
||||
{% block title %}Shop Dashboard{% endblock %} |
||||
|
||||
{% block breadcrumbs %} |
||||
<div class="breadcrumbs"> |
||||
<a href="{% url 'admin:index' %}">Home</a> |
||||
› <a href="{% url 'admin:app_list' app_label='shop' %}">Shop</a> |
||||
› Dashboard |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block content %} |
||||
<div class="dashboard"> |
||||
<div class="dashboard-stats" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 20px 0;"> |
||||
|
||||
<!-- Order Status Cards --> |
||||
<div class="stat-card" style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px;"> |
||||
<h3 style="margin: 0 0 15px 0; color: #495057;">Orders by Status</h3> |
||||
<div class="status-list"> |
||||
{% for status_data in order_status_data %} |
||||
<div class="status-item" style="display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #e9ecef;"> |
||||
<span style="font-weight: 500; color: #495057;">{{ status_data.label }}</span> |
||||
<div style="display: flex; align-items: center; gap: 10px;"> |
||||
<span class="count" style="background: #007bff; color: white; padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: bold;"> |
||||
{{ status_data.count }} |
||||
</span> |
||||
<span class="total" style="color: #28a745; font-weight: 500;"> |
||||
€{{ status_data.total_amount|floatformat:2 }} |
||||
</span> |
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Total Summary Card --> |
||||
<div class="stat-card" style="background: linear-gradient(135deg, #007bff, #0056b3); color: white; border-radius: 8px; padding: 20px;"> |
||||
<h3 style="margin: 0 0 15px 0;">Total Summary</h3> |
||||
<div class="summary-stats"> |
||||
<div style="margin-bottom: 10px;"> |
||||
<div style="font-size: 24px; font-weight: bold;">{{ total_orders }}</div> |
||||
<div style="opacity: 0.9;">Total Orders</div> |
||||
</div> |
||||
<div> |
||||
<div style="font-size: 24px; font-weight: bold;">€{{ total_revenue|floatformat:2 }}</div> |
||||
<div style="opacity: 0.9;">Total Revenue</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Recent Activity Card --> |
||||
<div class="stat-card" style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px;"> |
||||
<h3 style="margin: 0 0 15px 0; color: #495057;">Recent Activity</h3> |
||||
<div class="recent-stats"> |
||||
<div style="margin-bottom: 10px;"> |
||||
<div style="font-size: 18px; font-weight: bold; color: #28a745;">{{ orders_today }}</div> |
||||
<div style="color: #6c757d; font-size: 14px;">Orders Today</div> |
||||
</div> |
||||
<div style="margin-bottom: 10px;"> |
||||
<div style="font-size: 18px; font-weight: bold; color: #ffc107;">{{ orders_this_week }}</div> |
||||
<div style="color: #6c757d; font-size: 14px;">Orders This Week</div> |
||||
</div> |
||||
<div> |
||||
<div style="font-size: 18px; font-weight: bold; color: #17a2b8;">{{ orders_this_month }}</div> |
||||
<div style="color: #6c757d; font-size: 14px;">Orders This Month</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Quick Actions Card --> |
||||
<div class="stat-card" style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px;"> |
||||
<h3 style="margin: 0 0 15px 0; color: #495057;">Quick Actions</h3> |
||||
<div class="quick-actions"> |
||||
<a href="{% url 'admin:shop_order_changelist' %}" |
||||
style="display: block; padding: 8px 12px; margin-bottom: 8px; background: #007bff; color: white; text-decoration: none; border-radius: 4px; text-align: center;"> |
||||
View All Orders |
||||
</a> |
||||
<a href="{% url 'admin:shop_order_changelist' %}?show_preparation=1" |
||||
style="display: block; padding: 8px 12px; margin-bottom: 8px; background: #28a745; color: white; text-decoration: none; border-radius: 4px; text-align: center;"> |
||||
Orders to Prepare ({{ orders_to_prepare }}) |
||||
</a> |
||||
<a href="{% url 'admin:shop_product_changelist' %}" |
||||
style="display: block; padding: 8px 12px; margin-bottom: 8px; background: #6c757d; color: white; text-decoration: none; border-radius: 4px; text-align: center;"> |
||||
Manage Products |
||||
</a> |
||||
<a href="{% url 'admin:shop_coupon_changelist' %}" |
||||
style="display: block; padding: 8px 12px; background: #ffc107; color: #212529; text-decoration: none; border-radius: 4px; text-align: center;"> |
||||
Manage Coupons |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Detailed Status Breakdown --> |
||||
<div class="detailed-breakdown" style="background: white; border: 1px solid #dee2e6; border-radius: 8px; padding: 20px; margin-top: 20px;"> |
||||
<h3 style="margin: 0 0 20px 0; color: #495057;">Status Breakdown</h3> |
||||
<div style="overflow-x: auto;"> |
||||
<table style="width: 100%; border-collapse: collapse;"> |
||||
<thead> |
||||
<tr style="background: #f8f9fa;"> |
||||
<th style="padding: 12px; text-align: left; border-bottom: 2px solid #dee2e6;">Status</th> |
||||
<th style="padding: 12px; text-align: center; border-bottom: 2px solid #dee2e6;">Count</th> |
||||
<th style="padding: 12px; text-align: center; border-bottom: 2px solid #dee2e6;">Percentage</th> |
||||
<th style="padding: 12px; text-align: right; border-bottom: 2px solid #dee2e6;">Total Value</th> |
||||
<th style="padding: 12px; text-align: right; border-bottom: 2px solid #dee2e6;">Avg Order Value</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for status_data in order_status_data %} |
||||
<tr style="border-bottom: 1px solid #dee2e6;"> |
||||
<td style="padding: 12px; font-weight: 500;">{{ status_data.label }}</td> |
||||
<td style="padding: 12px; text-align: center;"> |
||||
<span style="background: #007bff; color: white; padding: 4px 8px; border-radius: 12px; font-size: 12px;"> |
||||
{{ status_data.count }} |
||||
</span> |
||||
</td> |
||||
<td style="padding: 12px; text-align: center;">{{ status_data.percentage|floatformat:1 }}%</td> |
||||
<td style="padding: 12px; text-align: right; color: #28a745; font-weight: 500;"> |
||||
€{{ status_data.total_amount|floatformat:2 }} |
||||
</td> |
||||
<td style="padding: 12px; text-align: right;"> |
||||
{% if status_data.count > 0 %} |
||||
€{{ status_data.avg_order_value|floatformat:2 }} |
||||
{% else %} |
||||
€0.00 |
||||
{% endif %} |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<style> |
||||
.dashboard { |
||||
max-width: 1200px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.stat-card { |
||||
transition: transform 0.2s ease, box-shadow 0.2s ease; |
||||
} |
||||
|
||||
.stat-card:hover { |
||||
transform: translateY(-2px); |
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1); |
||||
} |
||||
|
||||
.quick-actions a:hover { |
||||
opacity: 0.9; |
||||
} |
||||
|
||||
@media (max-width: 768px) { |
||||
.dashboard-stats { |
||||
grid-template-columns: 1fr !important; |
||||
} |
||||
} |
||||
</style> |
||||
{% endblock %} |
||||
@ -0,0 +1,446 @@ |
||||
{% extends "admin/base_site.html" %} |
||||
{% load admin_urls %} |
||||
|
||||
{% block title %}Tournament Dashboard{% endblock %} |
||||
|
||||
{% block breadcrumbs %} |
||||
<div class="breadcrumbs"> |
||||
<a href="{% url 'admin:index' %}">Home</a> |
||||
› <a href="{% url 'admin:app_list' app_label='tournaments' %}">Tournaments</a> |
||||
› Dashboard |
||||
</div> |
||||
{% endblock %} |
||||
|
||||
{% block content %} |
||||
<div class="tournament-dashboard"> |
||||
<h1>🏆 Tournament Dashboard</h1> |
||||
|
||||
<!-- Summary Statistics Cards --> |
||||
<div class="dashboard-stats" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 20px 0;"> |
||||
|
||||
<!-- Running Tournaments Card --> |
||||
<div class="stat-card" style="background: linear-gradient(135deg, #28a745, #20c997); color: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);"> |
||||
<h3 style="margin: 0 0 20px 0; display: flex; align-items: center; gap: 10px;"> |
||||
🎾 Starting Tournaments |
||||
</h3> |
||||
<div class="tournament-stats"> |
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 15px;"> |
||||
<div> |
||||
<div style="font-size: 28px; font-weight: bold;">{{ tournaments_today_total }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">Today</div> |
||||
</div> |
||||
<div style="text-align: right;"> |
||||
<div style="font-size: 16px;">{{ tournaments_today_private }}/{{ tournaments_today_public }}</div> |
||||
<div style="opacity: 0.9; font-size: 12px;">Private/Public</div> |
||||
</div> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 15px;"> |
||||
<div> |
||||
<div style="font-size: 24px; font-weight: bold;">{{ tournaments_week_total }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">This Week</div> |
||||
</div> |
||||
<div style="text-align: right;"> |
||||
<div style="font-size: 16px;">{{ tournaments_week_private }}/{{ tournaments_week_public }}</div> |
||||
<div style="opacity: 0.9; font-size: 12px;">Private/Public</div> |
||||
</div> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between;"> |
||||
<div> |
||||
<div style="font-size: 24px; font-weight: bold;">{{ tournaments_month_total }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">This Month</div> |
||||
</div> |
||||
<div style="text-align: right;"> |
||||
<div style="font-size: 16px;">{{ tournaments_month_private }}/{{ tournaments_month_public }}</div> |
||||
<div style="opacity: 0.9; font-size: 12px;">Private/Public</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Ended Tournaments Card --> |
||||
<div class="stat-card" style="background: linear-gradient(135deg, #dc3545, #e74c3c); color: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);"> |
||||
<h3 style="margin: 0 0 20px 0; display: flex; align-items: center; gap: 10px;"> |
||||
🏁 Ended Tournaments |
||||
</h3> |
||||
<div class="tournament-stats"> |
||||
<div style="margin-bottom: 15px;"> |
||||
<div style="font-size: 28px; font-weight: bold;">{{ tournaments_ended_today }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">Today</div> |
||||
</div> |
||||
<div style="margin-bottom: 15px;"> |
||||
<div style="font-size: 24px; font-weight: bold;">{{ tournaments_ended_week }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">This Week</div> |
||||
</div> |
||||
<div style="margin-bottom: 15px;"> |
||||
<div style="font-size: 24px; font-weight: bold;">{{ tournaments_ended_month }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">This Month</div> |
||||
</div> |
||||
<div> |
||||
<div style="font-size: 20px; font-weight: bold;">{{ tournaments_ended_all }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">All Time</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Participants Card --> |
||||
<div class="stat-card" style="background: linear-gradient(135deg, #007bff, #0056b3); color: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);"> |
||||
<h3 style="margin: 0 0 20px 0; display: flex; align-items: center; gap: 10px;"> |
||||
👥 Participants |
||||
</h3> |
||||
<div class="participant-stats"> |
||||
<div style="margin-bottom: 20px;"> |
||||
<div style="font-size: 32px; font-weight: bold;">{{ total_teams }}</div> |
||||
<div style="opacity: 0.9; font-size: 16px;">Total Teams</div> |
||||
</div> |
||||
<div style="margin-bottom: 20px;"> |
||||
<div style="font-size: 32px; font-weight: bold;">{{ total_players }}</div> |
||||
<div style="opacity: 0.9; font-size: 16px;">Total Players</div> |
||||
</div> |
||||
<div> |
||||
<div style="font-size: 20px; font-weight: bold;">{{ avg_teams_per_tournament }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">Avg Teams/Tournament</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Matches Card --> |
||||
<div class="stat-card" style="background: linear-gradient(135deg, #fd7e14, #e55e2b); color: white; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);"> |
||||
<h3 style="margin: 0 0 20px 0; display: flex; align-items: center; gap: 10px;"> |
||||
🏓 Matches |
||||
</h3> |
||||
<div class="match-stats"> |
||||
<div style="margin-bottom: 20px;"> |
||||
<div style="font-size: 32px; font-weight: bold;">{{ total_matches }}</div> |
||||
<div style="opacity: 0.9; font-size: 16px;">Total Matches</div> |
||||
</div> |
||||
<div style="margin-bottom: 20px;"> |
||||
<div style="font-size: 28px; font-weight: bold; color: #90EE90;">{{ matches_played }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">Played</div> |
||||
</div> |
||||
<div> |
||||
<div style="font-size: 24px; font-weight: bold; color: #FFB6C1;">{{ matches_pending }}</div> |
||||
<div style="opacity: 0.9; font-size: 14px;">Pending</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- New User Statistics --> |
||||
<div class="user-section" style="background: white; border: 1px solid #dee2e6; border-radius: 12px; padding: 25px; margin: 20px 0;"> |
||||
<h3 style="margin: 0 0 20px 0; color: #495057; display: flex; align-items: center; gap: 10px;"> |
||||
👤 User Statistics |
||||
</h3> |
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px;"> |
||||
<!-- User Counts by Origin --> |
||||
<div style="background: #f8f9fa; border-radius: 8px; padding: 20px;"> |
||||
<h4 style="margin: 0 0 15px 0;">Total Users: {{ total_users }}</h4> |
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;"> |
||||
<span>Admin:</span> |
||||
<strong>{{ users_admin }}</strong> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;"> |
||||
<span>Site:</span> |
||||
<strong>{{ users_site }}</strong> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between;"> |
||||
<span>App:</span> |
||||
<strong>{{ users_app }}</strong> |
||||
</div> |
||||
<div style="margin-top: 15px;"> |
||||
<div style="height: 20px; background: #e9ecef; border-radius: 10px; overflow: hidden; display: flex;"> |
||||
{% if total_users > 0 %} |
||||
<div style="width: {{ users_admin|floatformat:0 }}%; height: 100%; background: #6c757d;" title="Admin: {{ users_admin }}"></div> |
||||
<div style="width: {{ users_site|floatformat:0 }}%; height: 100%; background: #28a745;" title="Site: {{ users_site }}"></div> |
||||
<div style="width: {{ users_app|floatformat:0 }}%; height: 100%; background: #007bff;" title="App: {{ users_app }}"></div> |
||||
{% endif %} |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; margin-top: 5px; font-size: 12px;"> |
||||
<span>Admin</span> |
||||
<span>Site</span> |
||||
<span>App</span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- New User Registrations --> |
||||
<div style="background: #f8f9fa; border-radius: 8px; padding: 20px;"> |
||||
<h4 style="margin: 0 0 15px 0;">New Registrations</h4> |
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;"> |
||||
<span>Today:</span> |
||||
<div style="padding: 4px 12px; background: #007bff; color: white; border-radius: 15px; font-weight: bold;">{{ users_today }}</div> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;"> |
||||
<span>This Week:</span> |
||||
<div style="padding: 4px 12px; background: #28a745; color: white; border-radius: 15px; font-weight: bold;">{{ users_this_week }}</div> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; align-items: center;"> |
||||
<span>This Month:</span> |
||||
<div style="padding: 4px 12px; background: #fd7e14; color: white; border-radius: 15px; font-weight: bold;">{{ users_this_month }}</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Recent Users --> |
||||
<div style="background: #f8f9fa; border-radius: 8px; padding: 20px; grid-column: span 2;"> |
||||
<h4 style="margin: 0 0 15px 0; display: flex; justify-content: space-between; align-items: center;"> |
||||
<span>Recently Registered Users</span> |
||||
<a href="{% url 'admin:tournaments_customuser_changelist' %}" style="font-size: 14px; text-decoration: none; color: #007bff; display: flex; align-items: center;"> |
||||
View All Users <span style="margin-left: 5px; font-size: 16px;">→</span> |
||||
</a> |
||||
</h4> |
||||
<div style="overflow-x: auto;"> |
||||
<table style="width: 100%; border-collapse: collapse;"> |
||||
<thead> |
||||
<tr style="border-bottom: 2px solid #dee2e6;"> |
||||
<th style="padding: 8px 12px; text-align: left;">Name</th> |
||||
<th style="padding: 8px 12px; text-align: left;">Email</th> |
||||
<th style="padding: 8px 12px; text-align: left;">Origin</th> |
||||
<th style="padding: 8px 12px; text-align: left;">Date Joined</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for user in recent_users %} |
||||
<tr style="border-bottom: 1px solid #dee2e6;"> |
||||
<td style="padding: 8px 12px;">{{ user.first_name }} {{ user.last_name }}</td> |
||||
<td style="padding: 8px 12px;">{{ user.email }}</td> |
||||
<td style="padding: 8px 12px;"> |
||||
{% if user.origin == 0 %} |
||||
<span style="padding: 2px 6px; background: #6c757d; color: white; border-radius: 4px; font-size: 12px;">Admin</span> |
||||
{% elif user.origin == 1 %} |
||||
<span style="padding: 2px 6px; background: #28a745; color: white; border-radius: 4px; font-size: 12px;">Site</span> |
||||
{% elif user.origin == 2 %} |
||||
<span style="padding: 2px 6px; background: #007bff; color: white; border-radius: 4px; font-size: 12px;">App</span> |
||||
{% else %} |
||||
<span style="padding: 2px 6px; background: #6c757d; color: white; border-radius: 4px; font-size: 12px;">Unknown</span> |
||||
{% endif %} |
||||
</td> |
||||
<td style="padding: 8px 12px;">{{ user.date_joined|date:"M d, Y H:i" }}</td> |
||||
</tr> |
||||
{% empty %} |
||||
<tr> |
||||
<td colspan="4" style="padding: 12px; text-align: center;">No recent users found.</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Purchase Statistics --> |
||||
<div class="purchase-section" style="background: white; border: 1px solid #dee2e6; border-radius: 12px; padding: 25px; margin: 20px 0;"> |
||||
<h3 style="margin: 0 0 20px 0; color: #495057; display: flex; align-items: center; gap: 10px;"> |
||||
💰 Purchase Statistics |
||||
</h3> |
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px;"> |
||||
<!-- Purchase Counts --> |
||||
<div style="background: #f8f9fa; border-radius: 8px; padding: 20px;"> |
||||
<h4 style="margin: 0 0 15px 0;">Total Purchases: {{ total_purchases }}</h4> |
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;"> |
||||
<span>Today:</span> |
||||
<div style="padding: 4px 12px; background: #007bff; color: white; border-radius: 15px; font-weight: bold;">{{ purchases_today }}</div> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;"> |
||||
<span>This Week:</span> |
||||
<div style="padding: 4px 12px; background: #28a745; color: white; border-radius: 15px; font-weight: bold;">{{ purchases_this_week }}</div> |
||||
</div> |
||||
<div style="display: flex; justify-content: space-between; align-items: center;"> |
||||
<span>This Month:</span> |
||||
<div style="padding: 4px 12px; background: #fd7e14; color: white; border-radius: 15px; font-weight: bold;">{{ purchases_this_month }}</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Recent Purchases --> |
||||
<div style="background: #f8f9fa; border-radius: 8px; padding: 20px; grid-column: span 3;"> |
||||
<h4 style="margin: 0 0 15px 0;">Recent Purchases</h4> |
||||
<div style="overflow-x: auto;"> |
||||
<table style="width: 100%; border-collapse: collapse;"> |
||||
<thead> |
||||
<tr style="border-bottom: 2px solid #dee2e6;"> |
||||
<th style="padding: 8px 12px; text-align: left;">ID</th> |
||||
<th style="padding: 8px 12px; text-align: left;">User</th> |
||||
<th style="padding: 8px 12px; text-align: left;">Product</th> |
||||
<th style="padding: 8px 12px; text-align: left;">Quantity</th> |
||||
<th style="padding: 8px 12px; text-align: left;">Date</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for purchase in recent_purchases %} |
||||
<tr style="border-bottom: 1px solid #dee2e6;"> |
||||
<td style="padding: 8px 12px;">{{ purchase.id }}</td> |
||||
<td style="padding: 8px 12px;">{{ purchase.user.email }}</td> |
||||
<td style="padding: 8px 12px;">{{ purchase.product_id }}</td> |
||||
<td style="padding: 8px 12px;">{{ purchase.quantity }}</td> |
||||
<td style="padding: 8px 12px;">{{ purchase.purchase_date|date:"M d, Y H:i" }}</td> |
||||
</tr> |
||||
{% empty %} |
||||
<tr> |
||||
<td colspan="5" style="padding: 12px; text-align: center;">No recent purchases found.</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- All Time Overview --> |
||||
<div class="all-time-section" style="background: white; border: 1px solid #dee2e6; border-radius: 12px; padding: 25px; margin: 20px 0;"> |
||||
<h3 style="margin: 0 0 20px 0; color: #495057; display: flex; align-items: center; gap: 10px;"> |
||||
📊 All Time Overview |
||||
</h3> |
||||
<div class="overview-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;"> |
||||
<div class="overview-item" style="text-align: center; padding: 15px; background: #f8f9fa; border-radius: 8px;"> |
||||
<div style="font-size: 24px; font-weight: bold; color: #28a745;">{{ tournaments_all_total }}</div> |
||||
<div style="color: #6c757d; margin-top: 5px;">Total Tournaments</div> |
||||
<div style="font-size: 12px; color: #6c757d; margin-top: 5px;"> |
||||
{{ tournaments_all_private }} Private | {{ tournaments_all_public }} Public |
||||
</div> |
||||
</div> |
||||
<div class="overview-item" style="text-align: center; padding: 15px; background: #f8f9fa; border-radius: 8px;"> |
||||
<div style="font-size: 24px; font-weight: bold; color: #007bff;">{{ tournaments_with_online_reg }}</div> |
||||
<div style="color: #6c757d; margin-top: 5px;">Online Registration</div> |
||||
</div> |
||||
<div class="overview-item" style="text-align: center; padding: 15px; background: #f8f9fa; border-radius: 8px;"> |
||||
<div style="font-size: 24px; font-weight: bold; color: #ffc107;">{{ tournaments_with_payment }}</div> |
||||
<div style="color: #6c757d; margin-top: 5px;">Online Payment</div> |
||||
</div> |
||||
<div class="overview-item" style="text-align: center; padding: 15px; background: #f8f9fa; border-radius: 8px;"> |
||||
<div style="font-size: 24px; font-weight: bold; color: #17a2b8;">€{{ avg_entry_fee }}</div> |
||||
<div style="color: #6c757d; margin-top: 5px;">Avg Entry Fee</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Detailed Breakdown Table --> |
||||
<div class="detailed-breakdown" style="background: white; border: 1px solid #dee2e6; border-radius: 12px; padding: 25px; margin-top: 20px;"> |
||||
<h3 style="margin: 0 0 20px 0; color: #495057;">📈 Tournament Breakdown</h3> |
||||
<div style="overflow-x: auto;"> |
||||
<table style="width: 100%; border-collapse: collapse;"> |
||||
<thead> |
||||
<tr style="background: #f8f9fa;"> |
||||
<th style="padding: 15px; text-align: left; border-bottom: 2px solid #dee2e6;">Period</th> |
||||
<th style="padding: 15px; text-align: center; border-bottom: 2px solid #dee2e6;">Running</th> |
||||
<th style="padding: 15px; text-align: center; border-bottom: 2px solid #dee2e6;">Private</th> |
||||
<th style="padding: 15px; text-align: center; border-bottom: 2px solid #dee2e6;">Public</th> |
||||
<th style="padding: 15px; text-align: center; border-bottom: 2px solid #dee2e6;">Ended</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr style="border-bottom: 1px solid #dee2e6;"> |
||||
<td style="padding: 15px; font-weight: 500;">Today</td> |
||||
<td style="padding: 15px; text-align: center;"> |
||||
<span style="background: #28a745; color: white; padding: 6px 12px; border-radius: 15px; font-weight: bold;"> |
||||
{{ tournaments_today_total }} |
||||
</span> |
||||
</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_today_private }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_today_public }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #dc3545; font-weight: 500;">{{ tournaments_ended_today }}</td> |
||||
</tr> |
||||
<tr style="border-bottom: 1px solid #dee2e6;"> |
||||
<td style="padding: 15px; font-weight: 500;">This Week</td> |
||||
<td style="padding: 15px; text-align: center;"> |
||||
<span style="background: #28a745; color: white; padding: 6px 12px; border-radius: 15px; font-weight: bold;"> |
||||
{{ tournaments_week_total }} |
||||
</span> |
||||
</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_week_private }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_week_public }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #dc3545; font-weight: 500;">{{ tournaments_ended_week }}</td> |
||||
</tr> |
||||
<tr style="border-bottom: 1px solid #dee2e6;"> |
||||
<td style="padding: 15px; font-weight: 500;">This Month</td> |
||||
<td style="padding: 15px; text-align: center;"> |
||||
<span style="background: #28a745; color: white; padding: 6px 12px; border-radius: 15px; font-weight: bold;"> |
||||
{{ tournaments_month_total }} |
||||
</span> |
||||
</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_month_private }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_month_public }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #dc3545; font-weight: 500;">{{ tournaments_ended_month }}</td> |
||||
</tr> |
||||
<tr> |
||||
<td style="padding: 15px; font-weight: 500;">All Time</td> |
||||
<td style="padding: 15px; text-align: center;"> |
||||
<span style="background: #007bff; color: white; padding: 6px 12px; border-radius: 15px; font-weight: bold;"> |
||||
{{ tournaments_all_total }} |
||||
</span> |
||||
</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_all_private }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #6c757d;">{{ tournaments_all_public }}</td> |
||||
<td style="padding: 15px; text-align: center; color: #dc3545; font-weight: 500;">{{ tournaments_ended_all }}</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Quick Actions --> |
||||
<div class="quick-actions" style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 12px; padding: 25px; margin-top: 20px;"> |
||||
<h3 style="margin: 0 0 20px 0; color: #495057;">🚀 Quick Actions</h3> |
||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px;"> |
||||
<a href="{% url 'admin:tournaments_tournament_changelist' %}" |
||||
style="display: block; padding: 12px 15px; background: #007bff; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> |
||||
View All Tournaments |
||||
</a> |
||||
<a href="{% url 'admin:tournaments_teamregistration_changelist' %}" |
||||
style="display: block; padding: 12px 15px; background: #28a745; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> |
||||
Manage Teams |
||||
</a> |
||||
<a href="{% url 'admin:tournaments_playerregistration_changelist' %}" |
||||
style="display: block; padding: 12px 15px; background: #6c757d; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> |
||||
Manage Players |
||||
</a> |
||||
<a href="{% url 'admin:tournaments_match_changelist' %}" |
||||
style="display: block; padding: 12px 15px; background: #fd7e14; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> |
||||
View Matches |
||||
</a> |
||||
<a href="{% url 'admin:tournaments_event_changelist' %}" |
||||
style="display: block; padding: 12px 15px; background: #17a2b8; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> |
||||
Manage Events |
||||
</a> |
||||
<a href="{% url 'admin:tournaments_club_changelist' %}" |
||||
style="display: block; padding: 12px 15px; background: #ffc107; color: #212529; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> |
||||
Manage Clubs |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<style> |
||||
.tournament-dashboard { |
||||
max-width: 1400px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.stat-card { |
||||
transition: transform 0.3s ease, box-shadow 0.3s ease; |
||||
} |
||||
|
||||
.stat-card:hover { |
||||
transform: translateY(-3px); |
||||
box-shadow: 0 8px 25px rgba(0,0,0,0.15); |
||||
} |
||||
|
||||
.quick-actions a:hover { |
||||
opacity: 0.9; |
||||
transform: translateY(-1px); |
||||
} |
||||
|
||||
@media (max-width: 768px) { |
||||
.dashboard-stats { |
||||
grid-template-columns: 1fr !important; |
||||
} |
||||
|
||||
.overview-grid { |
||||
grid-template-columns: repeat(2, 1fr) !important; |
||||
} |
||||
|
||||
.quick-actions > div { |
||||
grid-template-columns: 1fr !important; |
||||
} |
||||
} |
||||
</style> |
||||
{% endblock %} |
||||
@ -0,0 +1,18 @@ |
||||
{% extends "admin/change_list.html" %} |
||||
|
||||
{% block object-tools %} |
||||
<ul class="object-tools"> |
||||
<li> |
||||
<a href="dashboard/" class="viewlink" style="background: #007bff; color: white;"> |
||||
📊 Dashboard |
||||
</a> |
||||
</li> |
||||
{% if has_add_permission %} |
||||
<li> |
||||
<a href="{% url 'admin:tournaments_tournament_add' %}" class="addlink"> |
||||
Add Tournament |
||||
</a> |
||||
</li> |
||||
{% endif %} |
||||
</ul> |
||||
{% endblock %} |
||||
@ -1,14 +1,18 @@ |
||||
|
||||
<nav class="margin10"> |
||||
<a href="{% url 'index' %}" class="orange">Accueil</a> |
||||
<a href="{% url 'clubs' %}" class="orange">Clubs</a> |
||||
{% if user.is_authenticated %} |
||||
<a href="{% url 'my-tournaments' %}" class="orange">Mes tournois</a> |
||||
<a href="{% url 'shop:my_orders' %}">Mes commandes</a> |
||||
<a href="{% url 'profile' %}">Mon compte</a> |
||||
{% else %} |
||||
<a href="{% url 'custom-login' %}">Se connecter</a> |
||||
{% endif %} |
||||
<a href="{% url 'shop:product_list' %}">La boutique</a> |
||||
<a href="{% url 'download' %}" class="download-button">Ajouter vos tournois</a> |
||||
</nav> |
||||
<nav class="margin10"> |
||||
<a href="{% url 'index' %}" class="orange">Accueil</a> |
||||
<a href="{% url 'clubs' %}" class="orange">Clubs</a> |
||||
{% if user.is_authenticated %} |
||||
<a href="{% url 'my-tournaments' %}" class="orange">Mes tournois</a> |
||||
<a href="{% url 'shop:my_orders' %}">Mes commandes</a> |
||||
<a href="{% url 'profile' %}">Mon compte</a> |
||||
{% else %} |
||||
<a href="{% url 'custom-login' %}">Se connecter</a> |
||||
{% endif %} |
||||
<a href="{% url 'shop:product_list' %}">La boutique</a> |
||||
{% if user.is_authenticated and user.is_staff %} |
||||
<a href="{% url 'private-tournaments' %}" class="orange">Tournois privés</a> |
||||
<a href="{% url 'admin:tournaments_tournament_dashboard' %}" class="download-button">Tableau de bord</a> |
||||
{% else %} |
||||
<a href="{% url 'download' %}" class="download-button">Ajouter vos tournois</a> |
||||
{% endif %} |
||||
</nav> |
||||
|
||||
Loading…
Reference in new issue