From 36cf1cc2c47f15b440a070d02959426c5805a269 Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 10 Aug 2012 02:53:04 +0530 Subject: [PATCH] Fix id outputting in fuzzystops template Eliminate Save button --- chaloBEST/mumbai/views.py | 2 +- chaloBEST/templates/fuzzystops.html | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/chaloBEST/mumbai/views.py b/chaloBEST/mumbai/views.py index 7c0546c..9599bec 100644 --- a/chaloBEST/mumbai/views.py +++ b/chaloBEST/mumbai/views.py @@ -113,7 +113,7 @@ def fuzzystops(request): end = int(request.GET.get("end", start + 50)) show_checked = request.GET.get("show_checked", False) unrs = [] - for unr in UniqueRoute.objects.all(): + for unr in UniqueRoute.objects.all().order_by('route__code'): if FuzzyStopMatch.objects.filter(unr=unr).filter(checked=True).count() > 0: if not show_checked: diff --git a/chaloBEST/templates/fuzzystops.html b/chaloBEST/templates/fuzzystops.html index 1ffb4d0..0ad68b0 100644 --- a/chaloBEST/templates/fuzzystops.html +++ b/chaloBEST/templates/fuzzystops.html @@ -40,11 +40,13 @@ $(function() { $('.fromStopSelect').change(function() { var firstOpt = $(this).children().first(); firstOpt.attr("selected") ? $(this).removeClass("notfirstStop") : $(this).addClass("notfirstStop"); + $(this).parents('tr').find('.submitFuzzyEdit').click(); }); $('.toStopSelect').change(function() { var lastOpt = $(this).children().last(); lastOpt.attr("selected") ? $(this).removeClass("notlastStop") : $(this).addClass("notlastStop"); + $(this).parents('tr').find('.submitFuzzyEdit').click(); }); }); @@ -95,7 +97,7 @@ function saveUNR(elem, markChecked) { {% for u in unrs %} - + {{ u.unr.route.alias }} {{ u.unr.from_stop_txt }} @@ -121,7 +123,7 @@ function saveUNR(elem, markChecked) { -   +