1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add select2-bootstrap for consistent widget styling

This commit is contained in:
Jeremy Stretch
2019-01-23 10:18:44 -05:00
parent 14695037da
commit 4227c6b806
3 changed files with 17 additions and 7 deletions

View File

@ -99,15 +99,17 @@ $(document).ready(function() {
$('.netbox-select2-color-picker').select2({
allowClear: true,
placeholder: "---------",
theme: "bootstrap",
templateResult: colorPickerClassCopy,
templateSelection: colorPickerClassCopy,
})
templateSelection: colorPickerClassCopy
});
// Static choice selection
$('.netbox-select2-static').select2({
allowClear: true,
placeholder: "---------",
})
theme: "bootstrap"
});
// API backed selection
// Includes live search and chained fields
@ -115,7 +117,7 @@ $(document).ready(function() {
$('.netbox-select2-api').select2({
allowClear: true,
placeholder: "---------",
theme: "bootstrap",
ajax: {
delay: 500,
@ -168,7 +170,7 @@ $(document).ready(function() {
parameters[_val[0]] = _val[1];
}
}
})
});
// Additional query params
$.each(element.attributes, function(index, attr){
@ -176,7 +178,7 @@ $(document).ready(function() {
var param_name = attr.name.split("data-additional-query-param-")[1]
parameters[param_name] = attr.value;
}
})
});
// This will handle params with multiple values (i.e. for list filter forms)
return $.param(parameters, true);

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,7 @@
<link rel="stylesheet" href="{% static 'font-awesome-4.7.0/css/font-awesome.min.css' %}">
<link rel="stylesheet" href="{% static 'jquery-ui-1.12.1/jquery-ui.css' %}">
<link rel="stylesheet" href="{% static 'select2-4.0.5/css/select2.min.css' %}">
<link rel="stylesheet" href="{% static 'select2-bootstrap-0.1.0-beta.10/select2-bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'css/base.css' %}?v{{ settings.VERSION }}">
<link rel="icon" type="image/png" href="{% static 'img/netbox.ico' %}" />
<meta charset="UTF-8">