edited fuzzystops to indicate first/last stop v2

This commit is contained in:
Johnson Chetty 2012-08-09 22:05:25 +02:00
parent 2883e8b133
commit 5372afe74b
2 changed files with 11 additions and 6 deletions

View File

@ -117,12 +117,12 @@ def fuzzystops(request):
unrd = {}
fs = False
ls = False
if unr.from_stop==rds[0]:
if unr.from_stop==rds[0].stop:
fs=True
else:
fs=False
if unr.to_stop==rds[len(rds)-1]:
if unr.to_stop==rds[len(rds)-1].stop:
ls=True
else:
ls=False
@ -131,7 +131,7 @@ def fuzzystops(request):
# import pdb
# pdb.set_trace()
context = RequestContext(request, {
'unrs': unrs[0:100]
'unrs': unrs[0:20]
})
return render_to_response("fuzzystops.html", context)

View File

@ -21,6 +21,11 @@
<html>
<head>
<script type="text/javascript" src="/static/js/jquery-1.7.1.min.js"></script>
<style>
.notfirstStop { background-color: #ffdddd }
.notlastStop { background-color: #ffdddd }
</style>
<script type="text/javascript">
$(function() {
$('.submitFuzzyEdit').click(function() {
@ -83,7 +88,7 @@ function saveUNR(elem, markChecked) {
<td>{{ u.unr.route.alias }}</td>
<td>{{ u.unr.from_stop_txt }}</td>
<td>
<select class="fromStopSelect {% if u.fs %} firstStop {% endif %}" >
<select class="fromStopSelect {% if not u.stop_is_first %} notfirstStop {% endif %}" >
{% for stop in u.unr.get_stop_choices %}
<option value="{{ stop.id }}" {% ifequal u.unr.from_stop stop %} selected="selected" {% endifequal %}>
{{ stop.display_name }}
@ -91,10 +96,10 @@ function saveUNR(elem, markChecked) {
{% endfor %}
</select>
</td>
<td>{{ u.unr.to_stop_txt }}</td>
<td>
<select class="toStopSelect {% if u.fs %} lastStop {% endif %}" >
<select class="toStopSelect {% if not u.stop_is_last %} notlastStop {% endif %}" >
{% for stop in u.unr.get_stop_choices %}
<option value="{{ stop.id }}" {% ifequal u.unr.to_stop stop %} selected="selected" {% endifequal %}>
{{ stop.display_name }}