stats revised with columnar display

This commit is contained in:
Johnson Chetty 2012-02-23 13:51:10 +01:00
parent 1360bbe4b7
commit 34555ebb0a
2 changed files with 34 additions and 10 deletions

View File

@ -76,12 +76,17 @@ def stats(request):
routes = routes_sorted
areas = areas_sorted
return render_to_response("stats.html", {
routes.reverse()
areas.reverse()
context = {
'total_stop_count': total_stops,
'total_stops_left': total_stops_left,
'areas': areas,
'routes': routes
})
}
#return context
return render_to_response("stats.html", context)

View File

@ -5,11 +5,11 @@
{% endblock %}
{% block head %}
<meta http-equiv="refresh" content="45">
<meta http-equiv="refresh" content="60">
<style type ="text/css">
body {
width: 80%;
width: 92%;
margin: 0 auto;
background-color:#ff9900
}
@ -29,9 +29,28 @@
.areas {
color:#000000;
background-color:#00ccff;
background-color:#ccff99;
}
ul{
width:900px;
margin-bottom:20px;
overflow:hidden;
border-top:1px solid #ccc;
}
li{
line-height:1.5em;
/*border-bottom:1px solid #ccc; */
float:left;
display:inline;
}
double li { width:50%;} /* 2 col */
.triple li { width:33.333%; } /* 3 col */
</style>
@ -45,13 +64,13 @@
<h1> ChaloBEST! The Stats..
</h1>
</div>
<div class="stops"> <h2>Total Stops : {{ total_stop_count }} <br /> Stops left : {{ total_stops_left }}</h2> <br /> <br />
<div class="stops"> <h2>Total Stops : {{ total_stop_count }} <br /> Stops left : {{ total_stops_left }}</h2>
</div>
<div class="routes"> <h3> Routes: </h3><br />
<ul id="routesList">
<ul id="routesList" class="triple" >
{% for r in routes %}
<li class="route listItem">
<li class="route listItem" >
<a href="{{r.route.get_absolute_url}}" title="view stops for route"> {{ r.route.alias }} </a>
- {{ r.stops_done }} / {{ r.total_stops }}
</li>
@ -60,7 +79,7 @@
</div>
<div class="areas"> <h3> Areas: </h3> <br />
<ul id="AreasList">
<ul id="AreasList" class="triple" >
{% for a in areas %}
<li class="area listItem">
<a href="{{a.area.get_absolute_url}}" title="view stops for area">{{ a.area.name }}</a> - {{ a.stops_done }} / {{ a.total_stops }}.