summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-27 21:49:00 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-27 21:56:34 +0200
commitf1366d27a7ccfcd2745aa0854f217941f6b2198c (patch)
treebe28b6af27e8dd9750c93ba7296c25363eedb08e
parent13bfe02ca67ec54df5895202fbee8a809a6b7245 (diff)
downloadIshtar-f1366d27a7ccfcd2745aa0854f217941f6b2198c.tar.bz2
Ishtar-f1366d27a7ccfcd2745aa0854f217941f6b2198c.zip
Person - organization: add precise town field
-rw-r--r--ishtar_common/forms_common.py14
-rw-r--r--ishtar_common/templates/ishtar/sheet_person.html5
-rw-r--r--ishtar_common/templates/ishtar/wizard/wizard_person.html1
3 files changed, 14 insertions, 6 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py
index d35d2f5e6..4c7fb32aa 100644
--- a/ishtar_common/forms_common.py
+++ b/ishtar_common/forms_common.py
@@ -312,7 +312,8 @@ class TargetKeyFormset(BaseModelFormSet):
class OrganizationForm(ManageOldType, NewItemForm):
form_label = _(u"Organization")
- associated_models = {'organization_type': models.OrganizationType}
+ associated_models = {'organization_type': models.OrganizationType,
+ "precise_town": models.Town}
name = forms.CharField(
label=_(u"Name"), max_length=300, validators=[name_validator])
organization_type = forms.ChoiceField(label=_(u"Organization type"),
@@ -323,7 +324,9 @@ class OrganizationForm(ManageOldType, NewItemForm):
widget=forms.Textarea, required=False)
postal_code = forms.CharField(label=_(u"Postal code"), max_length=10,
required=False)
- town = forms.CharField(label=_(u"Town"), max_length=30, required=False)
+ town = forms.CharField(label=_("Town (freeform)"), max_length=30,
+ required=False)
+ precise_town = get_town_field(required=False)
country = forms.CharField(label=_(u"Country"), max_length=30,
required=False)
email = forms.EmailField(label=_(u"Email"), required=False)
@@ -548,7 +551,8 @@ class PersonMergeIntoForm(MergeIntoForm):
class SimplePersonForm(ManageOldType, NewItemForm):
form_label = _("Identity")
associated_models = {'attached_to': models.Organization,
- 'title': models.TitleType}
+ 'title': models.TitleType,
+ "precise_town": models.Town}
title = forms.ChoiceField(label=_("Title"), choices=[], required=False)
salutation = forms.CharField(label=_("Salutation"), max_length=200,
required=False)
@@ -584,7 +588,9 @@ class SimplePersonForm(ManageOldType, NewItemForm):
label=_(u"Address complement"), widget=forms.Textarea, required=False)
postal_code = forms.CharField(label=_(u"Postal code"), max_length=10,
required=False)
- town = forms.CharField(label=_(u"Town"), max_length=30, required=False)
+ town = forms.CharField(label=_("Town (freeform)"), max_length=30,
+ required=False)
+ precise_town = get_town_field(required=False)
country = forms.CharField(label=_(u"Country"), max_length=30,
required=False)
alt_address = forms.CharField(label=_(u"Other address: address"),
diff --git a/ishtar_common/templates/ishtar/sheet_person.html b/ishtar_common/templates/ishtar/sheet_person.html
index dd9dc6be5..170d088ee 100644
--- a/ishtar_common/templates/ishtar/sheet_person.html
+++ b/ishtar_common/templates/ishtar/sheet_person.html
@@ -48,13 +48,14 @@
</table>
{% endif %}
-{% if item.address or item.postal_code or item.town %}
+{% if item.address or item.postal_code or item.town or item.precise_town %}
<h3>{% trans "Business address" %}</h3>
<div class="row">
{% field_flex "Address" item.address %}
{% field_flex "Address complement" item.address_complement %}
{% field_flex "Postal code" item.postal_code %}
- {% field_flex "Town" item.town %}
+ {% field_flex "Town (freeform)" item.town %}
+ {% field_flex "Town" item.precise_town %}
</div>{% endif %}
{% if item.alt_address or item.alt_postal_code or item.alt_town %}
diff --git a/ishtar_common/templates/ishtar/wizard/wizard_person.html b/ishtar_common/templates/ishtar/wizard/wizard_person.html
index 39aa76518..5be43cec7 100644
--- a/ishtar_common/templates/ishtar/wizard/wizard_person.html
+++ b/ishtar_common/templates/ishtar/wizard/wizard_person.html
@@ -69,6 +69,7 @@
{% bs_field wizard.form.address_complement %}
{% bs_field wizard.form.postal_code %}
{% bs_field wizard.form.town %}
+ {% bs_field wizard.form.precise_town %}
{% bs_field wizard.form.country %}
</div>
</div>