Fixes: 1) Add missing `constance.config` import in `views.py`; 2) Replace hardcoded timeframe logic with configurable period parsing; 3) Ensure proper handling of empty datasets for low stock and KPI calculations. Extra: Refactor dashboard templates to improve layout and add contextual adjustments (e.g., grid updates, daily sales title); Optimize cache handling for dashboard metrics; Cleanup unused legacy dashboard variables.
65 lines
No EOL
2.3 KiB
HTML
65 lines
No EOL
2.3 KiB
HTML
{% extends 'admin/base.html' %}
|
|
{% load i18n unfold static arith %}
|
|
|
|
{% block title %}
|
|
{% if subtitle %}
|
|
{{ subtitle }} |
|
|
{% endif %}
|
|
|
|
{{ title }} | {{ site_title|default:_('Django site admin') }}
|
|
{% endblock %}
|
|
|
|
{% block branding %}
|
|
{% include "unfold/helpers/site_branding.html" %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
{% component "unfold/components/container.html" %}
|
|
<div class="flex flex-col min-h-screen">
|
|
{% component "unfold/components/title.html" %}
|
|
{% trans "Dashboard" %}
|
|
<br/>
|
|
{% endcomponent %}
|
|
|
|
{% include "admin/dashboard/_filters.html" %}
|
|
|
|
{% include "admin/dashboard/_kpis.html" %}
|
|
|
|
<div class="grid grid-cols-1 xl:grid-cols-3 gap-6 items-start">
|
|
<div class="xl:col-span-2">
|
|
{% include "admin/dashboard/_daily_sales.html" %}
|
|
</div>
|
|
{% include "admin/dashboard/_income_overview.html" %}
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mt-6">
|
|
{% include "admin/dashboard/_low_stock.html" %}
|
|
{% include "admin/dashboard/_most_returned.html" %}
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mt-6">
|
|
{% include "admin/dashboard/_customers_mix.html" %}
|
|
{% if shipped_vs_digital.digital_qty|default:0 > 0 and shipped_vs_digital.shipped_qty|default:0 > 0 %}
|
|
{% include "admin/dashboard/_shipped_vs_digital.html" %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mt-6">
|
|
{% include "admin/dashboard/_top_categories.html" %}
|
|
{% include "admin/dashboard/_quick_links.html" %}
|
|
</div>
|
|
|
|
{% include "admin/dashboard/_product_lists.html" %}
|
|
|
|
{% component "unfold/components/separator.html" %}
|
|
{% endcomponent %}
|
|
|
|
<div class="mt-4 mt-auto">
|
|
{% component "unfold/components/text.html" with class="text-center text-xs text-gray-500 dark:text-gray-400" %}
|
|
eVibes {{ evibes_version }} · Wiseless Team
|
|
{% endcomponent %}
|
|
</div>
|
|
|
|
</div>
|
|
{% endcomponent %}
|
|
{% endblock %} |