Add library to improve user selection when sharing

This commit is contained in:
Gabriel Augendre 2019-03-04 21:31:26 +01:00
parent abe8fe1eb8
commit 7c367febaf
4 changed files with 15 additions and 2 deletions

View file

@ -17,6 +17,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="leaflet" level="application" />
<orderEntry type="library" name="bootstrap-select" level="application" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{leaflet}" />
<file url="file://$PROJECT_DIR$" libraries="{bootstrap-select, leaflet}" />
</component>
</project>

View file

@ -38,7 +38,10 @@ class LocationSharingForm(forms.ModelForm):
self.fields['shares_location_to'].label = 'Share location to'
self.fields['shares_location_to'].help_text = 'Hold <kbd>Ctrl</kbd> or <kbd>Cmd</kbd> to select multiple users'
self.fields['shares_location_to'].widget.attrs = {
'size': 10,
'data-size': 20,
'class': 'selectpicker',
'data-live-search': 'true',
'data-actions-box': 'true',
}

View file

@ -13,3 +13,12 @@
</div>
</div>
{% endblock %}
{% block add-head %}
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/css/bootstrap-select.min.css">
{% endblock %}
{% block js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/js/bootstrap-select.min.js"></script>
{% endblock %}