# HG changeset patch # User Lennard de Rijk # Date 1235859796 0 # Node ID cda9f118bfeffe1785330625406ccba4d97008f4 # Parent 6347d0a4fa7bc886106d89f515ae907223ef13c9 Improved Organization Application review overview and bulk reviewing. Both buttons now fade out and if no organizations can be accepted/rejected the buttons will not fade and a message will be shown to the user explaining the situation. Patch by: Mario Ferraro Reviewed by: Lennard de Rijk 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(""); diff -r 6347d0a4fa7b -r cda9f118bfef app/soc/templates/soc/org_app/review_overview.html --- a/app/soc/templates/soc/org_app/review_overview.html Sat Feb 28 21:26:28 2009 +0000 +++ b/app/soc/templates/soc/org_app/review_overview.html Sat Feb 28 22:23:16 2009 +0000 @@ -14,15 +14,12 @@ {% endcomment %} {% block body %} - -{% comment %} -TODO(ljvderijk) also make this button disappear -{% endcomment %} -