diff options
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index e5f4c67b1..7d954f378 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -270,10 +270,13 @@ class Select2Base(Select2Media): if self.new: html = u"<div class='input-group'>" url_new = 'new-' + self.model.SLUG - url_new = reverse(url_new) - 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 + url_new = reverse(url_new, args=["id_" + name]) + # WARNING: the modal for the form must be in the main template + # "extra_form_modals" list is used for that in form or view + 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, self.model.SLUG) html += super(Select2Base, self).render(name, value, attrs) html += new @@ -641,7 +644,8 @@ class JQueryAutoComplete(forms.TextInput): try: source = "'" + str(self.source) + "'" except: - raise ValueError('source type is not valid') + raise ValueError('{} source type is not valid'.format( + self.source)) dynamic_limit = [] for lim in self.dynamic_limit: field_ids = field_id.split('-') |