Add paging to Recordings Table (GRN2-26) (#512)

* Add translations for the validation messages

* Add translations for next/prev button

* Add paging to recordings

* sync

* Fix line endings
This commit is contained in:
shawn-higgins1
2019-05-14 09:01:41 -04:00
committed by Jesus Federico
parent d8f6c3f872
commit 23abdb52ee
18 changed files with 725 additions and 129 deletions

View File

@ -41,32 +41,6 @@ $(document).on('turbolinks:load', function(){
location.reload()
});
});
// Submit search if the user hits enter
$("#search-input").keypress(function(key) {
var keyPressed = key.which
if (keyPressed == 13) {
searchPage()
}
})
// Add listeners for sort
$("th[data-order]").click(function(data){
var header_elem = $(data.target)
if(header_elem.data('order') === 'asc'){ // asc
header_elem.data('order', 'desc');
}
else if(header_elem.data('order') === 'desc'){ // desc
header_elem.data('order', 'none');
}
else{ // none
header_elem.data('order', 'asc');
}
var search = $("#search-input").val()
window.location.replace(window.location.pathname + "?page=1&search=" + search + "&column=" + header_elem.data("header") + "&direction="+ header_elem.data('order'))
})
}
// Only run on the admins edit user page.
@ -76,8 +50,8 @@ $(document).on('turbolinks:load', function(){
if (!url.endsWith("/")) {
url += "/"
}
url += "admins?setting=" + data.target.id
window.location.href = url
})
}
@ -88,15 +62,3 @@ function changeBrandingImage(path) {
var url = $("#branding-url").val()
$.post(path, {url: url})
}
// Searches the user table for the given string
function searchPage() {
var search = $("#search-input").val()
window.location.replace(window.location.pathname + "?page=1&search=" + search)
}
// Clears the search bar
function clearSearch() {
window.location.replace(window.location.pathname + "?page=1")
}