diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-17 11:50:39 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-05-17 11:50:39 +0200 |
commit | 2401a5a5a156c3189e556d5dc6a2b4491942f48e (patch) | |
tree | 973acb445e94383445aa12b8ca0ddf4bb0057346 /ishtar_common | |
parent | 52855caf68fad158b19d4e0b5e990e8c517bac3e (diff) | |
download | Ishtar-2401a5a5a156c3189e556d5dc6a2b4491942f48e.tar.bz2 Ishtar-2401a5a5a156c3189e556d5dc6a2b4491942f48e.zip |
Operation wizard: collaborator panel more explicit style (refs #3595)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/static/media/style.css | 4 | ||||
-rw-r--r-- | ishtar_common/widgets.py | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/ishtar_common/static/media/style.css b/ishtar_common/static/media/style.css index 4e59b0f64..0016ca0e5 100644 --- a/ishtar_common/static/media/style.css +++ b/ishtar_common/static/media/style.css @@ -1483,6 +1483,10 @@ input.widget-oa{ /* select2 overload */ +.select2-container--default .full-width.select2-selection--multiple .select2-selection__choice{ + float: none; +} + .select2-container-multi .select2-choices .select2-search-field { min-width:233px; } diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 12db821c5..42a93ddaa 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -58,7 +58,7 @@ class Select2Multiple(forms.SelectMultiple): css = { 'all': ('select2/css/select2.css',) } - js = ['select2/js/select2.min.js'] + js = ['select2/js/select2.full.min.js'] for lang_code, lang in settings.LANGUAGES: js.append('select2/js/i18n/{}.js'.format(lang_code)) media.add_css(css) @@ -91,7 +91,11 @@ class Select2Multiple(forms.SelectMultiple): attrs = {} attrs['class'] = klass if 'style' not in attrs: - attrs['style'] = "width: 370px" + if attrs.get('full-width', None): + attrs['style'] = "width: 100%" + else: + attrs['style'] = "width: 370px" + options = "" if self.remote: options = """{ @@ -124,6 +128,12 @@ class Select2Multiple(forms.SelectMultiple): except (self.model.DoesNotExist, ValueError): # an old reference? it should not happen pass + if attrs.get('full-width', None): + if options: + options = options[:-1] + ", " + else: + options = "{" + options += " containerCssClass: 'full-width'}" html = super(Select2Multiple, self).render(name, value, attrs, choices) html += """<script type="text/javascript"> |