diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-12 21:19:19 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-09-12 21:19:58 +0200 |
commit | 7eaddb898570caaf19e94e3b2c889572eaf7a59c (patch) | |
tree | 9501168bcf42a290b63a6008faa75651e9fd61eb /ishtar_common/widgets.py | |
parent | 70f0fa29fac15c03f1c7af0f185b70be480b2d45 (diff) | |
download | Ishtar-7eaddb898570caaf19e94e3b2c889572eaf7a59c.tar.bz2 Ishtar-7eaddb898570caaf19e94e3b2c889572eaf7a59c.zip |
New management of popup for new items - manage author and persons
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']: |