From cf759a1ae850d3510dc4ad27e55d90c0d49aec89 Mon Sep 17 00:00:00 2001 From: Sushain Cherivirala Date: Fri, 27 Feb 2015 17:02:04 -0600 Subject: [PATCH] Add tests taken columns toggle (fixes #85) --- war/html/pages/dataRegistrations.html | 7 ++++--- war/js/pagescripts/data-registrations.js | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/war/html/pages/dataRegistrations.html b/war/html/pages/dataRegistrations.html index a485531..67323e5 100644 --- a/war/html/pages/dataRegistrations.html +++ b/war/html/pages/dataRegistrations.html @@ -110,6 +110,7 @@

$level.getName() School

@@ -123,7 +124,7 @@

$level.getName() School

+ #end @@ -225,7 +226,7 @@

$level.getName() School

#end #set($totalCost = $totalCost + $reg.getProperty("cost")) @@ -240,7 +241,7 @@

$level.getName() School

+ #end diff --git a/war/js/pagescripts/data-registrations.js b/war/js/pagescripts/data-registrations.js index 24d61cb..5136a3c 100644 --- a/war/js/pagescripts/data-registrations.js +++ b/war/js/pagescripts/data-registrations.js @@ -128,6 +128,26 @@ $(document).ready(function() { var t = parseInt($(this).index()) + 1; $('td:nth-child(' + t + '):not(tfoot td)', $(this).closest('table')).removeClass('highlighted'); }); + + $('.tablesorter-filter-row td:odd').slice(4).hide(); + $('.testsTakenColspan').attr('colspan', 1); + $('.testsTaken').hide(); + + $('button#testsTaken').click(function() { + var parent = $(this).parents('.tab-pane'); + if($(this).hasClass('active')) { + $('.tablesorter-filter-row td:odd', parent).slice(4).hide(); + $('.testsTakenColspan', parent).attr('colspan', 1); + $('.testsTaken', parent).hide(); + $(this).removeClass('active'); + } + else { + $('.tablesorter-filter-row td:odd', parent).slice(4).show(); + $('.testsTakenColspan', parent).attr('colspan', 2); + $('.testsTaken', parent).show(); + $(this).addClass('active'); + } + }); }); function sendAJAXReq(elem, value) {
$test$testCost
#if($reg.getProperty($test.toString().toUpperCase()))$reg.getProperty($test.toString().toUpperCase())#else 0 #end$testTotals.get($test)$testTotals.get($test)$$totalCost