feat: implement global searchable selects using Select2 and remove redundant per-view implementations

This commit is contained in:
2026-04-30 15:33:34 -04:00
parent 885161cc2b
commit 19f93f95bb
6 changed files with 23 additions and 154 deletions
+23
View File
@@ -12,6 +12,20 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<style>
.select2-container .select2-selection--single {
height: 34px;
border: 1px solid #ccc;
border-radius: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 34px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 32px;
}
</style>
@stack('styles')
</head>
<body>
@@ -255,6 +269,15 @@
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>
$(document).ready(function() {
$('select').select2({
placeholder: "Select an option",
allowClear: true
});
});
</script>
@stack('scripts')
</body>
</html>