forked from External/greenlight
Added filter for user role (#540)
This commit is contained in:
committed by
Jesus Federico
parent
eac8290001
commit
996518eea7
@ -31,8 +31,21 @@ $(document).on('turbolinks:load', function(){
|
||||
$("#delete-confirm").parent().attr("action", url)
|
||||
})
|
||||
|
||||
/* COLOR SELECTORS */
|
||||
//clear the role filter if user clicks on the x
|
||||
$(".clear-role").click(function(data) {
|
||||
search = new URL(location.href).searchParams.get('search')
|
||||
|
||||
url = window.location.pathname + "?page=1"
|
||||
|
||||
if (search) {
|
||||
url += "&search=" + search
|
||||
}
|
||||
|
||||
window.location.replace(url);
|
||||
})
|
||||
|
||||
/* COLOR SELECTORS */
|
||||
|
||||
$('#colorinput-regular').ColorPicker({
|
||||
onBeforeShow: function () {
|
||||
var colour = rgb2hex($("#colorinput-regular").css("background-color"))
|
||||
@ -93,6 +106,19 @@ function changeBrandingImage(path) {
|
||||
$.post(path, {url: url})
|
||||
}
|
||||
|
||||
// Filters by role
|
||||
function filterRole(role) {
|
||||
search = new URL(location.href).searchParams.get('search')
|
||||
|
||||
url = window.location.pathname + "?page=1" + "&role=" + role
|
||||
|
||||
if (search) {
|
||||
url += "&search=" + search
|
||||
}
|
||||
|
||||
window.location.replace(url);
|
||||
}
|
||||
|
||||
function rgb2hex(rgb) {
|
||||
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
||||
function hex(x) {
|
||||
@ -100,3 +126,4 @@ function rgb2hex(rgb) {
|
||||
}
|
||||
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
|
||||
}
|
||||
|
||||
|
@ -77,10 +77,19 @@ function searchPage() {
|
||||
var controller = $("body").data('controller');
|
||||
var action = $("body").data('action');
|
||||
|
||||
// Check if the user filtered by role
|
||||
role = new URL(location.href).searchParams.get('role')
|
||||
|
||||
url = window.location.pathname + "?page=1&search=" + search
|
||||
|
||||
if (role) {
|
||||
url += "&role=" + role
|
||||
}
|
||||
|
||||
if(controller === "rooms" && action === "show"){
|
||||
window.location.replace(window.location.pathname + "?page=1&search=" + search + "#recordings-table");
|
||||
window.location.replace(url + "#recordings-table");
|
||||
} else{
|
||||
window.location.replace(window.location.pathname + "?page=1&search=" + search);
|
||||
window.location.replace(url);
|
||||
}
|
||||
|
||||
}
|
||||
@ -90,9 +99,17 @@ function clearSearch() {
|
||||
var controller = $("body").data('controller');
|
||||
var action = $("body").data('action');
|
||||
|
||||
role = new URL(location.href).searchParams.get('role')
|
||||
|
||||
url = window.location.pathname + "?page=1"
|
||||
|
||||
if (role) {
|
||||
url += "&role=" + role
|
||||
}
|
||||
|
||||
if(controller === "rooms" && action === "show"){
|
||||
window.location.replace(window.location.pathname + "?page=1" + "#recordings-table");
|
||||
window.location.replace(url + "#recordings-table");
|
||||
} else{
|
||||
window.location.replace(window.location.pathname + "?page=1");
|
||||
window.location.replace(url);
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@
|
||||
@import "tabler/stamp";
|
||||
//@import "tabler/chat";
|
||||
//@import "tabler/example";
|
||||
//@import "tabler/tag";
|
||||
@import "tabler/tag";
|
||||
//@import "tabler/syntax";
|
||||
//@import "tabler/infobox";
|
||||
//@import "tabler/carousel";
|
||||
|
@ -15,8 +15,8 @@
|
||||
// with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#users-table {
|
||||
.user-role:hover {
|
||||
cursor: default;
|
||||
.user-role {
|
||||
color: white !important;
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,6 +31,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.tag i {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
#branding-image{
|
||||
z-index: auto;
|
||||
}
|
||||
|
Reference in New Issue
Block a user