diff -r 6347d0a4fa7b -r cda9f118bfef app/soc/content/js/bulk-review.js --- a/app/soc/content/js/bulk-review.js Sat Feb 28 21:26:28 2009 +0000 +++ b/app/soc/content/js/bulk-review.js Sat Feb 28 22:23:16 2009 +0000 @@ -2,14 +2,14 @@ $("#applications_progress_bar").progressBar({showText: false}); }); -function bulkReviewInit(bulk_review_link) { +function bulkReviewInit(bulk_review_link,button) { // get the JSON object with details of every application for bulk acceptance $.getJSON(bulk_review_link+"?_="+(new Date().getTime()), function(data){ // If there are applications to review... if (data.nr_applications != 0) { //...then fade out the button, show the progress bar and call the function for review - $("#button_bulk_review").fadeOut("slow", + $("[id^=button_bulk_]").fadeOut("slow", function() { $("#applications_progress_bar").progressBar(0); $("#description_done").html(""); @@ -17,7 +17,14 @@ } ); }else { - $("#description_done").html("No organizations to accept"); + var no_organization_text="No organizations to "; + if ($(button).attr("id").indexOf("reject")!=-1) { + no_organization_text+="reject"; + } + else { + no_organization_text+="accept"; + } + $("#description_done").html(""+no_organization_text+""); } } ); @@ -64,7 +71,7 @@ error: function(XMLHttpRequest, textStatus, errorThrown) { // if there is an error return the button and leave a try again message error_happened = true; - $("#button_bulk_review").fadeIn("slow", function() { + $("[id^=button_bulk_]").fadeIn("slow", function() { $("#description_done").html(" Error encountered, try again"); }); } @@ -81,7 +88,7 @@ $("#applications_progress_bar").fadeOut("slow", function() { $("#applications_progress_bar").progressBar(0); - $("#button_bulk_review").fadeIn("slow"); + $("[id^=button_bulk_]").fadeIn("slow"); } ); $("#description_progressbar").html("");