diff options
| -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} | 
