From d1e22bbbd1601e40378c911cdb41550e5246c85c Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Mon, 28 Dec 2020 22:24:35 +0100 Subject: [PATCH] Add django-autocomplete-light dependency --- pip_requirements.txt | 2 ++ static/css/autocomplete.css | 49 +++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 static/css/autocomplete.css diff --git a/pip_requirements.txt b/pip_requirements.txt index 2d0aba41..148a3b5b 100644 --- a/pip_requirements.txt +++ b/pip_requirements.txt @@ -1,2 +1,4 @@ django-bootstrap3==11.1.0 django-macaddress==1.6.0 +#django-autocomplete-light==3.2.10 # Until Django 2.0+ +django-autocomplete-light diff --git a/static/css/autocomplete.css b/static/css/autocomplete.css new file mode 100644 index 00000000..dea68af3 --- /dev/null +++ b/static/css/autocomplete.css @@ -0,0 +1,49 @@ +/* +Don't blame me for all the '!important's +See github.com/yourlabs/django-autocomplete-light/issues/1149 +*/ + +/* dal bootstrap css fix */ +.select2-container { + width: 100% !important; + min-width: 10em !important; +} + +/* django-addanother bootstrap css fix */ +.related-widget-wrapper{ + padding-right: 16px; + position: relative; +} + +.related-widget-wrapper-link{ + position: absolute; + top: 3px; + right: 0px; +} + +.select2-container .select2-selection--single { + height: 34px !important; + padding-right: 20px; +} + +.select2-container--default .select2-selection--single .select2-selection__rendered { + line-height: 100% !important; + display: inline !important; + overflow-x: hidden !important; + overflow-y: auto !important; +} +.select2-container .select2-selection--multiple { + min-height: 45px !important; + padding-right: 20px; +} + +.select2-container--default .select2-selection--multiple .select2-selection__rendered { + height: 100% !important; + display: inline !imoortant; + overflow-x: hidden !important; + overflow-y: auto !important; +} + +.select2-container .select2-selection--multiple .select2-selection__rendered { + overflow: auto !important; +}