Fixed a bug in the Login and added a unit test to cover that.

Added a button to approve an individual request.
Fixed some minor bugs in the request screen
This commit is contained in:
Jamie Rees 2016-03-10 19:58:32 +00:00
commit 452ad07ba0
17 changed files with 238 additions and 25 deletions

View file

@ -13,6 +13,7 @@ var tvimer = 0;
movieLoad();
tvLoad();
// Approve all
$('#approveAll').click(function () {
$.ajax({
type: 'post',
@ -127,6 +128,34 @@ $(document).on("click", ".delete", function (e) {
});
// Approve single request
$(document).on("click", ".approve", function (e) {
e.preventDefault();
var buttonId = e.target.id;
var $form = $('#approve' + buttonId);
$.ajax({
type: $form.prop('method'),
url: $form.prop('action'),
data: $form.serialize(),
dataType: "json",
success: function (response) {
if (checkJsonResponse(response)) {
generateNotify("Success! Request Approved.", "success");
$("button[custom-button='" + buttonId + "']").remove();
$("#" + buttonId + "notapproved").prop("class", "fa fa-check");
}
},
error: function (e) {
console.log(e);
generateNotify("Something went wrong!", "danger");
}
});
});
// Clear issues
$(document).on("click", ".clear", function (e) {
e.preventDefault();