diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-16 12:41:07 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-16 12:41:07 +0100 |
commit | 50907e3e001a2c71372c07904ef45abbf766835f (patch) | |
tree | 4a132b1bd534133c661e74d5f1afc68641773f9f /ishtar_common/widgets.py | |
parent | 5aba283c3d151b50cbcf35136d370d4676640fe0 (diff) | |
download | Ishtar-50907e3e001a2c71372c07904ef45abbf766835f.tar.bz2 Ishtar-50907e3e001a2c71372c07904ef45abbf766835f.zip |
UI: better layout for + button
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index e5cb35db4..59a034c00 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -387,7 +387,9 @@ class JQueryAutoComplete(forms.TextInput): attrs_select['class'] += ' form-control' new = '' + html = u"" if self.new: + html = u"<div class='input-group'>" model_name = self.associated_model._meta.object_name.lower() limits = [] for k in self.limit: @@ -400,9 +402,10 @@ class JQueryAutoComplete(forms.TextInput): if self.url_new: url_new = self.url_new url_new = reverse(url_new, args=args) - new = u' <a href="#" class="add-button" '\ - u'onclick="open_window(\'%s\');">+</a>' % url_new - html = u"""<input%(attrs_select)s/>%(new)s\ + new = u'<span class="input-group-addon">'\ + u'<a href="#" class="add-button" '\ + u'onclick="open_window(\'%s\');">+</a></span></div>' % url_new + html += u"""<input%(attrs_select)s/>%(new)s\ <input type="hidden"%(attrs_hidden)s/>\ <script type="text/javascript"><!--// %(js)s//--></script> |