From c1688869684e2fa841b00c0fa8327580d36ca191 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Sun, 14 Dec 2025 11:42:51 -0300 Subject: [PATCH] feat: improve text for rules --- app/apps/rules/forms.py | 5 ++++- app/templates/crispy-daisyui/layout/alert.html | 4 ++-- .../includes/scripts/hyperscript/htmx_error_handler.html | 6 +++--- app/templates/rules/fragments/list.html | 6 +++--- app/templates/rules/fragments/transaction_rule/view.html | 5 ++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/apps/rules/forms.py b/app/apps/rules/forms.py index c4e06af..fbe246c 100644 --- a/app/apps/rules/forms.py +++ b/app/apps/rules/forms.py @@ -1,3 +1,4 @@ +from crispy_forms.bootstrap import Alert from apps.common.fields.forms.dynamic_select import DynamicModelChoiceField from apps.common.widgets.crispy.daisyui import Switch from apps.common.widgets.crispy.submit import NoClassSubmit @@ -36,7 +37,6 @@ class TransactionRuleForm(forms.ModelForm): self.helper = FormHelper() self.helper.form_tag = False self.helper.form_method = "post" - # TO-DO: Add helper with available commands self.helper.layout = Layout( Switch("active"), "name", @@ -49,6 +49,9 @@ class TransactionRuleForm(forms.ModelForm): Switch("sequenced"), "description", "trigger", + Alert( + _("You can add actions to this rule in the next screen."), dismiss=True + ), ) if self.instance and self.instance.pk: diff --git a/app/templates/crispy-daisyui/layout/alert.html b/app/templates/crispy-daisyui/layout/alert.html index 2dad713..f8bb1c0 100644 --- a/app/templates/crispy-daisyui/layout/alert.html +++ b/app/templates/crispy-daisyui/layout/alert.html @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/app/templates/includes/scripts/hyperscript/htmx_error_handler.html b/app/templates/includes/scripts/hyperscript/htmx_error_handler.html index 1f7eb35..4f79973 100644 --- a/app/templates/includes/scripts/hyperscript/htmx_error_handler.html +++ b/app/templates/includes/scripts/hyperscript/htmx_error_handler.html @@ -10,9 +10,9 @@ behavior htmx_error_handler icon: 'warning', timer: 60000, customClass: { - confirmButton: 'btn btn-warning' -- Optional: different button style + confirmButton: 'btn btn-warning' }, - buttonsStyling: true + buttonsStyling: false }) else call Swal.fire({ @@ -23,7 +23,7 @@ behavior htmx_error_handler customClass: { confirmButton: 'btn btn-primary' }, - buttonsStyling: true + buttonsStyling: false }) end then log event diff --git a/app/templates/rules/fragments/list.html b/app/templates/rules/fragments/list.html index d66e580..07cb0f7 100644 --- a/app/templates/rules/fragments/list.html +++ b/app/templates/rules/fragments/list.html @@ -64,13 +64,13 @@ - - {% if rule.active %}{% else %} - {% endif %} + {% if rule.active %}{% else %} + {% endif %} diff --git a/app/templates/rules/fragments/transaction_rule/view.html b/app/templates/rules/fragments/transaction_rule/view.html index 6a4c96a..831f167 100644 --- a/app/templates/rules/fragments/transaction_rule/view.html +++ b/app/templates/rules/fragments/transaction_rule/view.html @@ -110,8 +110,7 @@ {% endfor %} -
-
+