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 | |
parent | 52855caf68fad158b19d4e0b5e990e8c517bac3e (diff) | |
download | Ishtar-2401a5a5a156c3189e556d5dc6a2b4491942f48e.tar.bz2 Ishtar-2401a5a5a156c3189e556d5dc6a2b4491942f48e.zip |
Operation wizard: collaborator panel more explicit style (refs #3595)
-rw-r--r-- | archaeological_operations/forms.py | 2 | ||||
-rw-r--r-- | ishtar_common/static/media/style.css | 4 | ||||
-rw-r--r-- | ishtar_common/widgets.py | 14 | ||||
-rw-r--r-- | version.py | 2 |
4 files changed, 18 insertions, 4 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index b9e68980f..8fd9233d2 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -994,7 +994,7 @@ class CollaboratorForm(forms.Form): def __init__(self, *args, **kwargs): super(CollaboratorForm, self).__init__(*args, **kwargs) - self.fields['collaborator'].widget.attrs['style'] = 'width: 100%' + self.fields['collaborator'].widget.attrs['full-width'] = True class OperationFormPreventive(forms.Form): 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"> diff --git a/version.py b/version.py index 32f59cc6b..bfe9a55fb 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 99, 19) +VERSION = (0, 99, 19, 1) def get_version(): |