mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
filter user
This commit is contained in:
parent
d2b47def81
commit
067e4e9d2d
@ -0,0 +1,3 @@
|
||||
select[name=filter_user] + .select2 {
|
||||
min-width: 20rem;
|
||||
}
|
||||
@ -41,11 +41,6 @@
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
top: unset;
|
||||
}
|
||||
|
||||
select[name=filter_User] + .select2 {
|
||||
min-width: 20rem;
|
||||
}
|
||||
|
||||
.navbar-collapse {
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
$(document).ready(function () {
|
||||
|
||||
// User filter
|
||||
$("select[name=filter_user]").select2({
|
||||
placeholder: $('select[name=filter_user] option:first-child').text(),
|
||||
ajax: {
|
||||
url: '/api/profile/query-users',
|
||||
dataType: 'json',
|
||||
processResults: function (data) {
|
||||
let formattedData = [];
|
||||
|
||||
Object.keys(data).forEach(function (id) {
|
||||
formattedData.push({
|
||||
'id': id,
|
||||
'text': data[id]
|
||||
})
|
||||
});
|
||||
|
||||
return {
|
||||
results: formattedData
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -145,29 +145,6 @@ $(document).ready(function () {
|
||||
filter.checkUser();
|
||||
});
|
||||
|
||||
// User filter
|
||||
$("select[name=filter_User]").select2({
|
||||
placeholder: $('select[name=filter_User] option:first-child').text(),
|
||||
ajax: {
|
||||
url: '/api/profile/query-users',
|
||||
dataType: 'json',
|
||||
processResults: function (data) {
|
||||
let formattedData = [];
|
||||
|
||||
Object.keys(data).forEach(function (id) {
|
||||
formattedData.push({
|
||||
'id': id,
|
||||
'text': data[id]
|
||||
})
|
||||
})
|
||||
|
||||
return {
|
||||
results: formattedData
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Country filter
|
||||
$("select[name=filter_country]").select2({
|
||||
placeholder: $('select[name=filter_country] option:first-child').text()
|
||||
|
||||
@ -89,7 +89,11 @@ class AdvTableBuilder extends TableBuilder
|
||||
*/
|
||||
protected $assets = [
|
||||
'scripts.js' => [
|
||||
'visiosoft.module.advs::js/admin/advanced.js'
|
||||
'visiosoft.module.advs::js/admin/advanced.js',
|
||||
'visiosoft.module.advs::js/admin/filter-user.js',
|
||||
],
|
||||
'styles.css' => [
|
||||
'visiosoft.module.advs::css/admin/filter-user.css',
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ class AdvTableFilters
|
||||
'query' => CategoryFilterQuery::class,
|
||||
'options' => $categories,
|
||||
],
|
||||
'User' => [
|
||||
'user' => [
|
||||
'exact' => true,
|
||||
'filter' => 'select',
|
||||
'query' => UserFilterQuery::class,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user