From 6c60c3659c7379f75b6c3ed0141e20fd7c2239c9 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Fri, 24 Jan 2025 22:47:00 -0300 Subject: [PATCH] feat(transactions): new is_paid switch --- app/apps/transactions/forms.py | 2 +- .../widgets/paid_toggle_button.html | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 app/templates/transactions/widgets/paid_toggle_button.html diff --git a/app/apps/transactions/forms.py b/app/apps/transactions/forms.py index 83de81d..6fbdcff 100644 --- a/app/apps/transactions/forms.py +++ b/app/apps/transactions/forms.py @@ -115,7 +115,7 @@ class TransactionForm(forms.ModelForm): "type", template="transactions/widgets/income_expense_toggle_buttons.html", ), - Switch("is_paid"), + Field("is_paid", template="transactions/widgets/paid_toggle_button.html"), Row( Column("account", css_class="form-group col-md-6 mb-0"), Column("entities", css_class="form-group col-md-6 mb-0"), diff --git a/app/templates/transactions/widgets/paid_toggle_button.html b/app/templates/transactions/widgets/paid_toggle_button.html new file mode 100644 index 0000000..bcd8877 --- /dev/null +++ b/app/templates/transactions/widgets/paid_toggle_button.html @@ -0,0 +1,18 @@ +{% load i18n %} +{% load crispy_forms_field %} + +
+
+ + + + + +
+ + {% if field.help_text %} +
{{ field.help_text|safe }}
+ {% endif %} +
\ No newline at end of file