add stats on matchstops page

This commit is contained in:
Sanj 2012-08-10 03:19:17 +05:30
parent 36cf1cc2c4
commit e78345d023
2 changed files with 19 additions and 1 deletions

View File

@ -139,8 +139,14 @@ def fuzzystops(request):
unrs.append({'unr':unr,'stop_is_first':fs,'stop_is_last':ls}) unrs.append({'unr':unr,'stop_is_first':fs,'stop_is_last':ls})
# import pdb # import pdb
# pdb.set_trace() # pdb.set_trace()
if end > len(unrs):
end = len(unrs)
context = RequestContext(request, { 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) return render_to_response("fuzzystops.html", context)

View File

@ -49,6 +49,12 @@ $(function() {
$(this).parents('tr').find('.submitFuzzyEdit').click(); $(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) { function saveUNR(elem, markChecked) {
@ -83,6 +89,12 @@ function saveUNR(elem, markChecked) {
</head> </head>
<body> <body>
<div id="stats">
Total Unique Routes remaining: {{ total }} &nbsp;
Showing <input size="1" id="start" value="{{ start }}" /> to <input size="1" id="end" value="{{ end }}" /> &nbsp;
<button id="reloadPage">Reload</button>
</div>
<table id="unrTable"> <table id="unrTable">
<thead> <thead>
<tr> <tr>