From c474263518651eb1a89caeb73e3df5913239c03c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 8 Apr 2016 03:31:08 +0200 Subject: Person form: improve alternate address label --- ishtar_common/templates/blocks/table_field.html | 2 +- ishtar_common/templates/ishtar/wizard/wizard_person.html | 10 +++++----- ishtar_common/templatetags/table_form.py | 7 +++++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/templates/blocks/table_field.html b/ishtar_common/templates/blocks/table_field.html index 5816a4b90..97d63ef46 100644 --- a/ishtar_common/templates/blocks/table_field.html +++ b/ishtar_common/templates/blocks/table_field.html @@ -1,4 +1,4 @@ - {{ field.label_tag }} + {% if label %}{{label}}{% else %}{{ field.label_tag }}{% endif %} {{ field.errors }}{{field|safe}} diff --git a/ishtar_common/templates/ishtar/wizard/wizard_person.html b/ishtar_common/templates/ishtar/wizard/wizard_person.html index c1806132f..85bbfc75e 100644 --- a/ishtar_common/templates/ishtar/wizard/wizard_person.html +++ b/ishtar_common/templates/ishtar/wizard/wizard_person.html @@ -49,11 +49,11 @@
- {% table_field wizard.form.alt_address %} - {% table_field wizard.form.alt_address_complement %} - {% table_field wizard.form.alt_postal_code %} - {% table_field wizard.form.alt_town %} - {% table_field wizard.form.alt_country %} + {% table_field wizard.form.alt_address 0 'Address' %} + {% table_field wizard.form.alt_address_complement 0 'Address complement' %} + {% table_field wizard.form.alt_postal_code 0 'Postal code' %} + {% table_field wizard.form.alt_town 0 'Town' %} + {% table_field wizard.form.alt_country 0 'Country' %}
{% trans "Other address" %}
{% endblock %} diff --git a/ishtar_common/templatetags/table_form.py b/ishtar_common/templatetags/table_form.py index 6f768183c..596301f89 100644 --- a/ishtar_common/templatetags/table_form.py +++ b/ishtar_common/templatetags/table_form.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- from django.template import Library +from django.utils.translation import ugettext_lazy as _ register = Library() @@ -12,5 +13,7 @@ def table_form(form): @register.inclusion_tag('blocks/table_field.html') -def table_field(field, required=False): - return {'field': field, 'required': required} +def table_field(field, required=False, label=None): + if label: + label = _(label) + return {'field': field, 'required': required, 'label': label} -- cgit v1.2.3