forked from External/greenlight
GRN2-128: Added the ability to manage rooms (#848)
* Added the ability to manage rooms * Small fixes * Fixed travis complaints * Fixed issues with role permissions * Fixed issue with delete room * Fixed rubocop and added testcases
This commit is contained in:
committed by
farhatahmad
parent
984e5cc085
commit
09de6b6739
@ -49,7 +49,9 @@ $(document).on('turbolinks:load', function(){
|
||||
$("#create-room-block").click(function(){
|
||||
showCreateRoom(this)
|
||||
})
|
||||
}
|
||||
|
||||
if (controller == "rooms" && action == "show" || controller == "admins" && action == "server_rooms"){
|
||||
// Display and update all fields related to creating a room in the createRoomModal
|
||||
$(".update-room").click(function(){
|
||||
showUpdateRoom(this)
|
||||
@ -88,9 +90,9 @@ function showCreateRoom(target) {
|
||||
|
||||
function showUpdateRoom(target) {
|
||||
var modal = $(target)
|
||||
var room_block_uid = modal.closest("#room-block").data("room-uid")
|
||||
$("#create-room-name").val(modal.closest("tbody").find("#room-name h4").text())
|
||||
$("#createRoomModal form").attr("action", room_block_uid + "/update_settings")
|
||||
var update_path = modal.closest("#room-block").data("path")
|
||||
$("#create-room-name").val(modal.closest("#room-block").find("#room-name-text").text())
|
||||
$("#createRoomModal form").attr("action", update_path)
|
||||
|
||||
//show all elements & their children with a update-only class
|
||||
$(".update-only").each(function() {
|
||||
|
@ -23,7 +23,8 @@ $(document).on('turbolinks:load', function(){
|
||||
(controller == "rooms" && action == "update") ||
|
||||
(controller == "rooms" && action == "join") ||
|
||||
(controller == "users" && action == "recordings") ||
|
||||
(controller == "admins" && action == "server_recordings")) {
|
||||
(controller == "admins" && action == "server_recordings") ||
|
||||
(controller == "admins" && action == "server_rooms")) {
|
||||
// Submit search if the user hits enter
|
||||
$("#search-input").keypress(function(key) {
|
||||
if (key.which == 13) {
|
||||
|
@ -52,15 +52,12 @@ $(document).on('turbolinks:load', function(){
|
||||
// Modify the ui for the tables
|
||||
var configure_order = function(header_elem){
|
||||
if(header_elem.data('order') === 'asc'){ // asc
|
||||
header_elem.text(header_elem.data("header") + " ↓");
|
||||
header_elem.data('order', 'desc');
|
||||
}
|
||||
else if(header_elem.data('order') === 'desc'){ // desc
|
||||
header_elem.text(header_elem.data("header"));
|
||||
header_elem.data('order', 'none');
|
||||
}
|
||||
else{ // none
|
||||
header_elem.text(header_elem.data("header") + " ↑");
|
||||
header_elem.data('order', 'asc');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user