mirror of
https://github.com/dani/vroom.git
synced 2024-06-30 15:23:41 +02:00
Implement room removal in the admin area
This commit is contained in:
parent
e14b8e479c
commit
7c80ca3358
|
@ -158,7 +158,7 @@ our %Lexicon = (
|
||||||
"ROOM_NOW_PERSISTENT" => "This room is now persistent",
|
"ROOM_NOW_PERSISTENT" => "This room is now persistent",
|
||||||
"ROOM_NO_MORE_PERSISTENT" => "This rooms isn't persistent anymore",
|
"ROOM_NO_MORE_PERSISTENT" => "This rooms isn't persistent anymore",
|
||||||
"EMAIL_INVITE" => "Email invitation",
|
"EMAIL_INVITE" => "Email invitation",
|
||||||
"DELETE_THIS_ROOM" => "Delete this room",
|
"DELETE" => "Delete",
|
||||||
"CONFIRM_DELETE" => "Confirm delation",
|
"CONFIRM_DELETE" => "Confirm delation",
|
||||||
"HELP_SET_DISPLAY_NAME" => "This field lets you type your name which will be displayed for other participants. " .
|
"HELP_SET_DISPLAY_NAME" => "This field lets you type your name which will be displayed for other participants. " .
|
||||||
"It must be set before you can use the chat. no need to validate anything, the name " .
|
"It must be set before you can use the chat. no need to validate anything, the name " .
|
||||||
|
|
|
@ -164,7 +164,7 @@ our %Lexicon = (
|
||||||
"ROOM_NOW_PERSISTENT" => "Ce salon est maintenant persistant",
|
"ROOM_NOW_PERSISTENT" => "Ce salon est maintenant persistant",
|
||||||
"ROOM_NO_MORE_PERSISTENT" => "Ce salon n'est plus persistant",
|
"ROOM_NO_MORE_PERSISTENT" => "Ce salon n'est plus persistant",
|
||||||
"EMAIL_INVITE" => "Invitation par email",
|
"EMAIL_INVITE" => "Invitation par email",
|
||||||
"DELETE_THIS_ROOM" => "Supprimer ce salon",
|
"DELETE" => "Supprimer",
|
||||||
"CONFIRM_DELETE" => "Confirmer la suppression",
|
"CONFIRM_DELETE" => "Confirmer la suppression",
|
||||||
"HELP_SET_DISPLAY_NAME" => "Ce champs vous permet de saisir le nom qui sera affiché pour les autres personnes. " .
|
"HELP_SET_DISPLAY_NAME" => "Ce champs vous permet de saisir le nom qui sera affiché pour les autres personnes. " .
|
||||||
"Il est obligatoire avant de pouvoir utiliser le tchat. Pas besoin de valider quoi " .
|
"Il est obligatoire avant de pouvoir utiliser le tchat. Pas besoin de valider quoi " .
|
||||||
|
|
|
@ -384,7 +384,7 @@ function initAdmin(){
|
||||||
|
|
||||||
// Update display of room list
|
// Update display of room list
|
||||||
function updateRoomList(filter, min, max){
|
function updateRoomList(filter, min, max){
|
||||||
$('#deviceList').html('');
|
$('#roomList').html('');
|
||||||
var filterRe = new RegExp(filter, "gi");
|
var filterRe = new RegExp(filter, "gi");
|
||||||
var i = 0;
|
var i = 0;
|
||||||
matches = 0;
|
matches = 0;
|
||||||
|
@ -486,8 +486,36 @@ function initAdmin(){
|
||||||
getRoomConf(roomName);
|
getRoomConf(roomName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-remove', function(){
|
||||||
|
roomName = $(this).data('room');
|
||||||
|
$('#deleteRoomModal').modal('show');
|
||||||
|
});
|
||||||
|
|
||||||
// Get room list right after loading the page
|
// Get room list right after loading the page
|
||||||
getRooms();
|
getRooms();
|
||||||
|
|
||||||
|
// Delete room form
|
||||||
|
$('#deleteRoomForm').submit(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$.ajax({
|
||||||
|
data: {
|
||||||
|
req: JSON.stringify({
|
||||||
|
action: 'delete_room',
|
||||||
|
param: {
|
||||||
|
room: roomName,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
error: function(data){
|
||||||
|
$.notify(locale.ERROR_OCCURRED, 'error');
|
||||||
|
},
|
||||||
|
success: function(data){
|
||||||
|
$.notify(data.msg, 'success');
|
||||||
|
getRooms();
|
||||||
|
$('#deleteRoomModal').modal('hide');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the main function called when you join a room
|
// This is the main function called when you join a room
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
%= include 'noscript'
|
%= include 'noscript'
|
||||||
%= include 'configure_modal'
|
%= include 'configure_modal'
|
||||||
%= include 'invite_modal'
|
%= include 'delete_room_modal'
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
|
|
34
templates/default/delete_room_modal.html.ep
Normal file
34
templates/default/delete_room_modal.html.ep
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<div class="modal fade" role="dialog" id="deleteRoomModal" aria-labelledby="deleteRoomModal" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">
|
||||||
|
<%=l 'CONFIRM_DELETE' %>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>
|
||||||
|
<%=l 'ROOM_WILL_BE_DELETED' %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<form id="deleteRoomForm" class="form-horizontal" role="form">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="col-sm-offset-4 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-danger">
|
||||||
|
<%=l 'DELETE' %>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-default" data-dismiss="modal">
|
||||||
|
<%=l 'CANCEL' %>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user