From 3500f667a947b6184555e23808b955985058a6d1 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Wed, 6 Nov 2024 17:07:22 -0300 Subject: [PATCH] feat: move action_bar to it's own cotton component and add basic sum of selected items --- app/templates/cotton/amount/display.html | 2 +- .../cotton/ui/transactions_action_bar.html | 80 +++++++++++++++++++ .../monthly_overview/fragments/list.html | 64 +-------------- .../transactions/fragments/list_all.html | 62 +------------- 4 files changed, 86 insertions(+), 122 deletions(-) create mode 100644 app/templates/cotton/ui/transactions_action_bar.html diff --git a/app/templates/cotton/amount/display.html b/app/templates/cotton/amount/display.html index e0513ed5..bb8a7208 100644 --- a/app/templates/cotton/amount/display.html +++ b/app/templates/cotton/amount/display.html @@ -2,6 +2,6 @@
+ data-original-value="{% currency_display amount=amount prefix=prefix suffix=suffix decimal_places=decimal_places %}" data-amount="{{ amount|floatformat:"-40u" }}">
diff --git a/app/templates/cotton/ui/transactions_action_bar.html b/app/templates/cotton/ui/transactions_action_bar.html new file mode 100644 index 00000000..e3ae2ac0 --- /dev/null +++ b/app/templates/cotton/ui/transactions_action_bar.html @@ -0,0 +1,80 @@ +{% load i18n %} +
+
+
+ {% spaceless %} +
+ + +
+
+
+ + +
+ +
+ + {% endspaceless %} +
+
+
diff --git a/app/templates/monthly_overview/fragments/list.html b/app/templates/monthly_overview/fragments/list.html index 8cbc9c31..23066877 100644 --- a/app/templates/monthly_overview/fragments/list.html +++ b/app/templates/monthly_overview/fragments/list.html @@ -2,14 +2,7 @@ {% load i18n %} {% regroup transactions by date|customnaturaldate as transactions_by_date %} -
+
{% for x in transactions_by_date %}
@@ -47,57 +40,6 @@ title="{% translate 'No transactions this month' %}" subtitle="{% translate "Try adding one" %}"> {% endfor %} - -
-
-
- {% spaceless %} -
- - -
-
-
- - -
- - {% endspaceless %} -
-
-
+{# Floating bar #} +
diff --git a/app/templates/transactions/fragments/list_all.html b/app/templates/transactions/fragments/list_all.html index 0e098191..2f0cf67c 100644 --- a/app/templates/transactions/fragments/list_all.html +++ b/app/templates/transactions/fragments/list_all.html @@ -3,14 +3,7 @@ {% regroup page_obj by date|customnaturaldate as transactions_by_date %} -
+
{% for x in transactions_by_date %}
@@ -127,57 +120,6 @@
{% endif %} {# Floating bar#} -
-
-
- {% spaceless %} -
- - -
-
-
- - -
- - {% endspaceless %} -
-
-
+