summaryrefslogtreecommitdiff
path: root/ishtar_common/widgets.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-01-09 09:55:51 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-01-09 09:55:51 +0100
commit028f25424bf00987856c350c06b6035863120b7a (patch)
treedcb254dac1a20cfb6cf42624d0a2f86447401de0 /ishtar_common/widgets.py
parent3cbe2d1450a18ccbb0deccb1561c99548cfbb1bb (diff)
downloadIshtar-028f25424bf00987856c350c06b6035863120b7a.tar.bz2
Ishtar-028f25424bf00987856c350c06b6035863120b7a.zip
Workon forms layout
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r--ishtar_common/widgets.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 6abaa927b..c34642cf1 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -277,6 +277,7 @@ class SquareMeterWidget(forms.TextInput):
rendered = t.render(dct)
return mark_safe(rendered)
+
AreaWidget = forms.TextInput
if settings.SURFACE_UNIT == 'square-metre':
@@ -424,6 +425,8 @@ class JQueryAutoComplete(forms.TextInput):
attrs_select['id'] = 'id_select_%s' % name
if 'class' not in attrs_select:
attrs_select['class'] = 'autocomplete'
+
+ attrs_select['class'] += ' form-control'
new = ''
if self.new:
model_name = self.associated_model._meta.object_name.lower()
@@ -440,11 +443,11 @@ class JQueryAutoComplete(forms.TextInput):
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\
+ html = u"""<input%(attrs_select)s/>%(new)s\
<input type="hidden"%(attrs_hidden)s/>\
<script type="text/javascript"><!--//
%(js)s//--></script>
- ''' % {
+ """ % {
'attrs_select': flatatt(attrs_select),
'attrs_hidden': flatatt(attrs_hidden),
'js': self.render_js(name),