From e78345d023d72fa2f136306bc4c42b891eb41c74 Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 10 Aug 2012 03:19:17 +0530 Subject: [PATCH] add stats on matchstops page --- chaloBEST/mumbai/views.py | 8 +++++++- chaloBEST/templates/fuzzystops.html | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/chaloBEST/mumbai/views.py b/chaloBEST/mumbai/views.py index 9599bec..facc55d 100644 --- a/chaloBEST/mumbai/views.py +++ b/chaloBEST/mumbai/views.py @@ -139,8 +139,14 @@ def fuzzystops(request): unrs.append({'unr':unr,'stop_is_first':fs,'stop_is_last':ls}) # import pdb # pdb.set_trace() + if end > len(unrs): + end = len(unrs) + context = RequestContext(request, { - 'unrs': unrs[start:end] + 'unrs': unrs[start:end], + 'total': len(unrs), + 'start': start, + 'end': end }) return render_to_response("fuzzystops.html", context) diff --git a/chaloBEST/templates/fuzzystops.html b/chaloBEST/templates/fuzzystops.html index 0ad68b0..4a1d25b 100644 --- a/chaloBEST/templates/fuzzystops.html +++ b/chaloBEST/templates/fuzzystops.html @@ -49,6 +49,12 @@ $(function() { $(this).parents('tr').find('.submitFuzzyEdit').click(); }); + $('#reloadPage').click(function() { + var start = $('#start').val(); + var end = $('#end').val(); + var url = location.pathname + "?start=" + start + "&end=" + end; + window.location.href = url; + }); }); function saveUNR(elem, markChecked) { @@ -83,6 +89,12 @@ function saveUNR(elem, markChecked) { +
+ Total Unique Routes remaining: {{ total }}   + Showing to   + + +