{% extends 'admin/base.html' %} {% load i18n unfold static %} {% 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" %}
{% component "unfold/components/title.html" %} {% trans "Dashboard" %}
{% endcomponent %}
{% component "unfold/components/card.html" %} {% component "unfold/components/text.html" %} {% trans "Revenue (gross, 30d)" %} {% endcomponent %} {% component "unfold/components/title.html" %} {% if currency_symbol %}{{ currency_symbol }}{% endif %}{{ revenue_gross_30|default:0 }} {% endcomponent %} {% endcomponent %} {% component "unfold/components/card.html" %} {% component "unfold/components/text.html" %} {% trans "Revenue (net, 30d)" %} {% endcomponent %} {% component "unfold/components/title.html" %} {% if currency_symbol %}{{ currency_symbol }}{% endif %}{{ revenue_net_30|default:0 }} {% endcomponent %} {% endcomponent %} {% component "unfold/components/card.html" %} {% component "unfold/components/text.html" %} {% trans "Returns (30d)" %} {% endcomponent %} {% component "unfold/components/title.html" %} {% if currency_symbol %}{{ currency_symbol }}{% endif %}{{ returns_30|default:0 }} {% endcomponent %} {% endcomponent %} {% component "unfold/components/card.html" %} {% component "unfold/components/text.html" %} {% trans "Processed orders (30d)" %} {% endcomponent %} {% component "unfold/components/title.html" %} {{ processed_orders_30|default:0 }} {% endcomponent %} {% endcomponent %}
{% with gross=revenue_gross_30|default:0 returns=returns_30|default:0 %} {% with total=gross|add:returns %} {% component "unfold/components/card.html" with class="xl:col-span-2" %} {% component "unfold/components/title.html" %} {% trans "Sales vs Returns (30d)" %} {% endcomponent %} {% if total and total > 0 %} {% with net=revenue_net_30|default:0 %} {% with tax_amt=gross|add:-net %} {% with returns_capped=returns %} {% if returns > gross %} {% with returns_capped=gross %}{% endwith %} {% endif %} {% with tax_amt_pos=tax_amt %} {% if tax_amt_pos < 0 %} {% with tax_amt_pos=0 %}{% endwith %} {% endif %} {% with net_for_pie=gross|add:-tax_amt_pos|add:-returns_capped %} {% if net_for_pie < 0 %} {% with net_for_pie=0 %}{% endwith %} {% endif %} {# Degrees per slice #} {% widthratio net_for_pie gross 360 as net_deg %} {% widthratio tax_amt_pos gross 360 as tax_deg %} {% widthratio returns_capped gross 360 as ret_deg %} {% with net_end=net_deg %} {% with tax_end=net_end|add:tax_deg %} {% with ret_end=tax_end|add:ret_deg %}
{% trans "Net" %}: {% if currency_symbol %} {{ currency_symbol }}{% endif %}{{ net }}
{% if tax_amt_pos > 0 %}
{% trans "Taxes" %}: {% if currency_symbol %} {{ currency_symbol }}{% endif %}{{ tax_amt_pos|floatformat:2 }}
{% endif %}
{% trans "Returns" %}: {% if currency_symbol %} {{ currency_symbol }}{% endif %}{{ returns }}
{% trans "Gross (pie total)" %}: {% if currency_symbol %} {{ currency_symbol }}{% endif %}{{ gross }}
{% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% endwith %} {% else %} {% component "unfold/components/text.html" %} {% trans "Not enough data for chart yet." %} {% endcomponent %} {% endif %} {% endcomponent %} {% endwith %} {% endwith %} {% component "unfold/components/card.html" %} {% component "unfold/components/title.html" %} {% trans "Quick Links" %} {% endcomponent %} {% if quick_links %} {% component "unfold/components/navigation.html" with class="flex flex-col gap-1" items=quick_links %} {% endcomponent %} {% else %} {% component "unfold/components/text.html" %} {% trans "No links available." %} {% endcomponent %} {% endif %} {% endcomponent %}
{% component "unfold/components/card.html" %} {% component "unfold/components/title.html" %} {% trans "Daily sales (30d)" %} {% endcomponent %} {% if daily_labels and daily_labels|length > 0 %}
{{ daily_labels|json_script:"daily-labels" }} {{ daily_orders|json_script:"daily-orders" }} {{ daily_gross|json_script:"daily-gross" }} {% else %} {% component "unfold/components/text.html" %} {% trans "Not enough data for chart yet." %} {% endcomponent %} {% endif %} {% endcomponent %}
{% component "unfold/components/card.html" %} {% component "unfold/components/title.html" %} {% trans "Most wished product" %} {% endcomponent %} {% if most_wished_products %} {% elif most_wished_product %} {% if most_wished_product.image %} {{ most_wished_product.name }} {% endif %} {{ most_wished_product.name }} {% else %} {% component "unfold/components/text.html" %} {% trans "No data yet." %} {% endcomponent %} {% endif %} {% endcomponent %} {% component "unfold/components/card.html" %} {% component "unfold/components/title.html" %} {% trans "Most popular product" %} {% endcomponent %} {% if most_popular_products %} {% elif most_popular_product %} {% if most_popular_product.image %} {{ most_popular_product.name }} {% endif %} {{ most_popular_product.name }} {% else %} {% component "unfold/components/text.html" %} {% trans "No data yet." %} {% endcomponent %} {% endif %} {% endcomponent %}
{% component "unfold/components/separator.html" %} {% endcomponent %}
{% component "unfold/components/text.html" with class="text-center text-xs text-gray-500 dark:text-gray-400" %} eVibes {{ evibes_version }} ยท Wiseless Team {% endcomponent %}
{% endcomponent %} {% endblock %}