|
|
|
@ -21,7 +21,7 @@ |
|
|
|
<!-- Running Tournaments Card --> |
|
|
|
<!-- 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);"> |
|
|
|
<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;"> |
|
|
|
<h3 style="margin: 0 0 20px 0; display: flex; align-items: center; gap: 10px;"> |
|
|
|
🎾 Running Tournaments |
|
|
|
🎾 Starting Tournaments |
|
|
|
</h3> |
|
|
|
</h3> |
|
|
|
<div class="tournament-stats"> |
|
|
|
<div class="tournament-stats"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 15px;"> |
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 15px;"> |
|
|
|
@ -125,6 +125,161 @@ |
|
|
|
</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;">Recently Registered Users</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 --> |
|
|
|
<!-- All Time Overview --> |
|
|
|
<div class="all-time-section" style="background: white; border: 1px solid #dee2e6; border-radius: 12px; padding: 25px; margin: 20px 0;"> |
|
|
|
<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;"> |
|
|
|
<h3 style="margin: 0 0 20px 0; color: #495057; display: flex; align-items: center; gap: 10px;"> |
|
|
|
|