From 066ef132f7456b0783a2b403b3f6b4106b50fdb9 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 4 Jul 2023 18:12:36 +0200 Subject: 🐛 fix parcel table - wizard summary (inappropriate l10n) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/templates/ishtar/wizard/confirm_wizard.html | 5 ++--- ishtar_common/templatetags/ishtar_helpers.py | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html index 56887d28b..e4fd739f6 100644 --- a/ishtar_common/templates/ishtar/wizard/confirm_wizard.html +++ b/ishtar_common/templates/ishtar/wizard/confirm_wizard.html @@ -1,6 +1,5 @@ {% extends "base.html" %} -{% load i18n %} -{% load range %} +{% load ishtar_helpers i18n l10n range %} {% block content %}

{{wizard_label}}

@@ -26,7 +25,7 @@
{% for data in form_data %} - + {% endfor %}
{{data.0}}{{data.1}}
{{data.0}}{% if data.1|is_numeric %}{{data.1|unlocalize}}{% else %}{{data.1}}{% endif %}
diff --git a/ishtar_common/templatetags/ishtar_helpers.py b/ishtar_common/templatetags/ishtar_helpers.py index f5946a9ea..28c70de0f 100644 --- a/ishtar_common/templatetags/ishtar_helpers.py +++ b/ishtar_common/templatetags/ishtar_helpers.py @@ -8,6 +8,15 @@ from django.utils.safestring import mark_safe register = Library() +@register.filter() +def is_numeric(value): + if isinstance(value, (int, float)): + return True + elif not isinstance(value, str): + return False + return value.isdigit() + + @register.filter def bs_field(input_field): input_field = str(input_field) -- cgit v1.2.3