diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-04-08 03:31:08 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-04-15 21:54:18 +0200 |
commit | b85f10cadaf9920c5206b0151c7b25946e684cd7 (patch) | |
tree | 146fc8b2008cbfc063bfbd391b6368ed964fb1b7 | |
parent | 1ea639ffc20ec75497e9f0ed1958348139740644 (diff) | |
download | Ishtar-b85f10cadaf9920c5206b0151c7b25946e684cd7.tar.bz2 Ishtar-b85f10cadaf9920c5206b0151c7b25946e684cd7.zip |
Person form: improve alternate address label
-rw-r--r-- | ishtar_common/templates/blocks/table_field.html | 2 | ||||
-rw-r--r-- | ishtar_common/templates/ishtar/wizard/wizard_person.html | 10 | ||||
-rw-r--r-- | ishtar_common/templatetags/table_form.py | 7 |
3 files changed, 11 insertions, 8 deletions
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 @@ <tr{% if required %} class='required'{% endif %}> - <th>{{ field.label_tag }}</th> + <th>{% if label %}{{label}}{% else %}{{ field.label_tag }}{% endif %}</th> <td> {{ field.errors }}{{field|safe}}</td> </tr> 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 @@ <hr class='spacer'/> <table class='formset'> <caption>{% trans "Other address" %}</caption> - {% 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' %} </table> {% 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} |