diff options
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 14d153651..79a705e43 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -703,6 +703,9 @@ class JQueryAutoComplete(forms.TextInput): new = '' html = u"" if self.new: + # WARNING: the modal for the form must be in the main template + # "extra_form_modals" list is used for that in view or wizard + html = u"<div class='input-group'>" model_name = self.associated_model._meta.object_name.lower() limits = [] @@ -716,9 +719,12 @@ class JQueryAutoComplete(forms.TextInput): if self.url_new: url_new = self.url_new url_new = reverse(url_new, args=args) - new = u'<span class="input-group-append">'\ - u'<a href="#" class="add-button input-group-text" '\ - u'onclick="open_window(\'%s\');">+</a></span></div>' % url_new + new = """ + <span class="input-group-append"> + <a href="#" class="add-button input-group-text" + onclick="dt_qa_open('{}', 'modal-dynamic-form-{}');">+</a> + </span></div> + """.format(url_new, model_name, model_name) old_value = "" if 'value' in attrs_select and attrs_select['value']: |