summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-10-28 14:41:04 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-10-28 14:41:52 +0100
commitbe6bb2b508d99a0f6ef3d1353d6785fdddf1656b (patch)
tree60e10a176cd1fbbe0afb151c1ab3fca7ad515fac
parentcba11779565c9c258388a61c90e760210b92fcaa (diff)
downloadIshtar-be6bb2b508d99a0f6ef3d1353d6785fdddf1656b.tar.bz2
Ishtar-be6bb2b508d99a0f6ef3d1353d6785fdddf1656b.zip
Autofocus on full text input on parcel form (refs #1463)
-rw-r--r--archaeological_operations/forms.py2
-rw-r--r--ishtar_common/wizards.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 6e025c4a4..9f8ab00fe 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -113,8 +113,10 @@ class ParcelFormSet(FormSet):
def __init__(self, *args, **kwargs):
super(FormSet, self).__init__(*args, **kwargs)
+ self.extra_form = None
if self.forms[0].__class__.__name__ == 'ParcelForm':
self.selection_form = ParcelSelectionForm()
+ self.extra_form = self.selection_form
def as_table(self):
# add dynamic widget
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index f27a2bd55..ec684650f 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -513,6 +513,9 @@ class Wizard(NamedUrlWizardView):
frm = None
if hasattr(form, 'fields') and form.fields.keys():
frm = form
+ elif hasattr(form, 'extra_form') and hasattr(form.extra_form, 'fields')\
+ and form.extra_form.fields.keys():
+ frm = form.extra_form
elif hasattr(form, 'forms') and form.forms and form.forms[0].fields.keys():
frm = form.forms[0]
if frm: