From c513bda3fd42d34c6a932f62bc39e7729fcac2f0 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Thu, 24 Oct 2024 16:27:28 -0300 Subject: [PATCH] feat: convert transaction-item to django-cotton --- app/templates/cotton/transaction/item.html | 144 ++++++++++++++++++ .../fragments/list_transactions.html | 4 +- .../monthly_overview/fragments/list.html | 5 +- .../fragments/list_transactions.html | 4 +- .../transactions/fragments/item.html | 1 - .../yearly_overview/fragments/list.html | 39 ----- 6 files changed, 153 insertions(+), 44 deletions(-) create mode 100644 app/templates/cotton/transaction/item.html delete mode 100644 app/templates/yearly_overview/fragments/list.html diff --git a/app/templates/cotton/transaction/item.html b/app/templates/cotton/transaction/item.html new file mode 100644 index 0000000..3b8f146 --- /dev/null +++ b/app/templates/cotton/transaction/item.html @@ -0,0 +1,144 @@ +{% load i18n %} +
+ {% if not disable_selection %} + + {% endif %} +
+
+ +
+{# Date#} +
+ {{ transaction.date|date:"SHORT_DATE_FORMAT" }} • {{ transaction.reference_date|date:"b/Y" }}
+{# Description#} +
+ {% spaceless %} + {{ transaction.description }} + {% if transaction.installment_plan and transaction.installment_id %} + {{ transaction.installment_id }}/{{ transaction.installment_plan.installment_total_number }} + {% endif %} + {% if transaction.recurring_transaction %} + + {% endif %} + {% endspaceless %} +
+
+{# Notes#} + {% if transaction.notes %} +
+ {{ transaction.notes | linebreaksbr }} +
+ {% endif %} + {% if transaction.category %} +
+ {% spaceless %} + + {{ transaction.category.name }} + {% endspaceless %} +
+ {% endif %} + {# Tags#} + {% with transaction.tags.all as tags %} + {% if tags %} +
+ {% for tag in tags %} + {{ tag.name }} + {% endfor %} +
+ {% endif %} + {% endwith %} +
+
+
+ + {# Exchange Rate#} + {% with exchanged=transaction.exchanged_amount %} + {% if exchanged %} + + {% endif %} + {% endwith %} +
{% if transaction.account.group %}{{ transaction.account.group.name }} • {% endif %}{{ transaction.account.name }}
+
+
+{# Item actions#} +
+
+ + + + +
+
+{# Item actions dropdown fallback for mobile#} + +
+
+
+
diff --git a/app/templates/installment_plans/fragments/list_transactions.html b/app/templates/installment_plans/fragments/list_transactions.html index 14f55a1..a7e6751 100644 --- a/app/templates/installment_plans/fragments/list_transactions.html +++ b/app/templates/installment_plans/fragments/list_transactions.html @@ -7,7 +7,9 @@ {% block body %}
{% for transaction in transactions %} - {% include 'transactions/fragments/item.html' with transaction=transaction disable_selection=True %} + {% endfor %}
{% endblock %} diff --git a/app/templates/monthly_overview/fragments/list.html b/app/templates/monthly_overview/fragments/list.html index e90d87c..0984b50 100644 --- a/app/templates/monthly_overview/fragments/list.html +++ b/app/templates/monthly_overview/fragments/list.html @@ -25,8 +25,9 @@
- {% for trans in x.list %} - {% include 'transactions/fragments/item.html' with transaction=trans %} + {% for transaction in x.list %} + {% endfor %}
diff --git a/app/templates/recurring_transactions/fragments/list_transactions.html b/app/templates/recurring_transactions/fragments/list_transactions.html index df50686..2d9aea1 100644 --- a/app/templates/recurring_transactions/fragments/list_transactions.html +++ b/app/templates/recurring_transactions/fragments/list_transactions.html @@ -7,7 +7,9 @@ {% block body %}
{% for transaction in transactions %} - {% include 'transactions/fragments/item.html' with transaction=transaction disable_selection=True %} + {% endfor %}
{% endblock %} diff --git a/app/templates/transactions/fragments/item.html b/app/templates/transactions/fragments/item.html index 9ed9a40..3b8f146 100644 --- a/app/templates/transactions/fragments/item.html +++ b/app/templates/transactions/fragments/item.html @@ -1,5 +1,4 @@ {% load i18n %} -{% load currency_display %}
{% if not disable_selection %}