summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit3ea67319cd18b8101f318ce4e151ce249fcf0096 (patch)
tree4a132b1bd534133c661e74d5f1afc68641773f9f
parenta6c11b0c0dfe2f6ab38fa0de3ff193c47a98903c (diff)
downloadIshtar-3ea67319cd18b8101f318ce4e151ce249fcf0096.tar.bz2
Ishtar-3ea67319cd18b8101f318ce4e151ce249fcf0096.zip
UI: better layout for + button
-rw-r--r--ishtar_common/widgets.py9
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>