Commit c5a32b5f authored by Leigh Stoller's avatar Leigh Stoller

Add a lockdown checkbox for Rob. This closes issue #76.

parent 6e9a0929
......@@ -87,7 +87,7 @@ function (_, sup, moment, mainString, waitwaitString, oopsString)
var howlong = $('#days').val();
var reason = $("#reason").val();
var method = (action == "extend" ? "RequestExtension" : "DenyExtension");
xf
var callback = function(json) {
sup.HideModal("#waitwait-modal");
......@@ -129,6 +129,10 @@ function (_, sup, moment, mainString, waitwaitString, oopsString)
.format("MMM D h:mm A"));
}
});
// lockout change event handler.
$('#lockout-checkbox').change(function() {
DoLockout($(this).is(":checked"));
});
}
});
}
......@@ -179,6 +183,25 @@ function (_, sup, moment, mainString, waitwaitString, oopsString)
});
}
//
// Request lockout set/clear.
//
function DoLockout(lockout)
{
lockout = (lockout ? 1 : 0);
var callback = function(json) {
if (json.code) {
alert("Failed to change lockout: " + json.value);
return;
}
}
var xmlthing = sup.CallServerMethod(null, "status", "Lockout",
{"uuid" : window.UUID,
"lockout" : lockout});
xmlthing.done(callback);
}
// Helper.
function decodejson(id) {
return JSON.parse(_.unescape($(id)[0].textContent));
......
......@@ -188,11 +188,13 @@ pre {
</tr>
<tr>
<td>Lockout:</td>
<td><% if (expinfo.lockout) { %>
<span class="text-danger">Yes</span><% } else { %>No<% } %></td>
<td><input type="checkbox" id="lockout-checkbox"
<% if (expinfo.lockout) { %>checked<% } %> >
</td>
<td>Lockdown:</td>
<td><% if (expinfo.lockdown) { %>
<span class="text-danger">Yes</span><% } else { %>No<% } %></td>
</td>
</tbody>
</table>
</div>
......@@ -200,7 +202,7 @@ pre {
</div>
</script>
</div>
<div>
<div>app
<script id="secondrow-template" type="text/template">
<div class='col-sm-6'>
<div class='panel panel-default'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment