diff --git a/app/assets/javascripts/admins.js b/app/assets/javascripts/admins.js
index 71b7cad1..0dff33ee 100644
--- a/app/assets/javascripts/admins.js
+++ b/app/assets/javascripts/admins.js
@@ -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]);
}
+
diff --git a/app/assets/javascripts/search.js b/app/assets/javascripts/search.js
index 80642256..c7d6d8db 100644
--- a/app/assets/javascripts/search.js
+++ b/app/assets/javascripts/search.js
@@ -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);
}
}
diff --git a/app/assets/stylesheets/_tabler-custom.scss b/app/assets/stylesheets/_tabler-custom.scss
index c87cabeb..9df7c337 100644
--- a/app/assets/stylesheets/_tabler-custom.scss
+++ b/app/assets/stylesheets/_tabler-custom.scss
@@ -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";
diff --git a/app/assets/stylesheets/admins.scss b/app/assets/stylesheets/admins.scss
index 2e87b611..b84cb410 100644
--- a/app/assets/stylesheets/admins.scss
+++ b/app/assets/stylesheets/admins.scss
@@ -15,8 +15,8 @@
// with BigBlueButton; if not, see