summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commite5dc6268a843e216ccf14469447d9b6f1ad43b49 (patch)
tree973acb445e94383445aa12b8ca0ddf4bb0057346
parent8451333f4e1a3cdaab05650141b154d2e5ee54fd (diff)
downloadIshtar-e5dc6268a843e216ccf14469447d9b6f1ad43b49.tar.bz2
Ishtar-e5dc6268a843e216ccf14469447d9b6f1ad43b49.zip
Operation wizard: collaborator panel more explicit style (refs #3595)
-rw-r--r--archaeological_operations/forms.py2
-rw-r--r--ishtar_common/static/media/style.css4
-rw-r--r--ishtar_common/widgets.py14
-rw-r--r--version.py2
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():