Features: 1) Refactored template logic to separate gross/returns context and total calculation for clarity;

Fixes: 1) Fixed duplicate `{% with %}` block causing syntax error;

Extra: 1) Improved template structure for maintainability; 2) Added missing closing `{% endwith %}`.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-11-16 15:07:45 +03:00
parent 41c6f20635
commit 338b2df0c9

View file

@ -38,7 +38,8 @@
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 items-center">
{% with gross=revenue_gross_30|default:0 returns=returns_30|default:0 total=gross|add:returns %}
{% with gross=revenue_gross_30|default:0 returns=returns_30|default:0 %}
{% with total=gross|add:returns %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center justify-between mb-4">
<h2 class="text-lg font-semibold">{% trans "Sales vs Returns (30d)" %}</h2>
@ -74,6 +75,7 @@
{% endif %}
</div>
{% endwith %}
{% endwith %}
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<h2 class="text-lg font-semibold mb-4">{% trans "Quick Links" %}</h2>