From 5e82b9c529bf2ae347d67de22994f85f2df04589 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 1 Feb 2015 22:34:01 +0100 Subject: [PATCH] Manage room persistence in admin area --- public/js/vroom.js | 3 +++ templates/default/configure_modal.html.ep | 10 ++++++++++ vroom.pl | 27 +++++++++------------------ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index 6b29128..95e6b8b 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -287,6 +287,7 @@ $('#configureRoomForm').submit(function(e){ $('#joinPass').val() : false, ownerPass = ($('#ownerPassSet').bootstrapSwitch('state')) ? $('#ownerPass').val() : false, + persistent = $('#persistentSet').bootstrapSwitch('state'), emails = []; $('input[name="emails[]"]').each(function(){ emails.push($(this).val()); @@ -301,6 +302,7 @@ $('#configureRoomForm').submit(function(e){ ask_for_name: askForName, join_password: joinPass, owner_password: ownerPass, + persistent: persistent, emails: emails } }) @@ -517,6 +519,7 @@ function initAdmin(){ $('#askForNameSet').bootstrapSwitch('state', data.ask_for_name == 'yes'); $('#joinPassSet').bootstrapSwitch('state', data.join_auth == 'yes'); $('#ownerPassSet').bootstrapSwitch('state', data.owner_auth == 'yes'); + $('#persistentSet').bootstrapSwitch('state', data.persistent == 'yes'); $('#configureModal').modal('show'); } }); diff --git a/templates/default/configure_modal.html.ep b/templates/default/configure_modal.html.ep index e2fa3e4..ab831aa 100644 --- a/templates/default/configure_modal.html.ep +++ b/templates/default/configure_modal.html.ep @@ -71,6 +71,16 @@ + <% if (defined(stash("admin")) && stash("admin") eq '1'){ %> +
+ +
+ +
+
+ <% } %>