Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

and made the view output return an avgs object, to match the way we h…

…andle guesses. now the shows view is concievably useful outside of the list func...
  • Loading branch information...
commit 7b573fb3d3b3305cae6f5d0bbd7e163556c2e79d 1 parent 3ad9de4
@cdcarter authored
View
8 lists/shows.js
@@ -14,10 +14,10 @@ function(head,req) {
var doc = row.value;
doc.venue = row.key;
doc.link = path.rewrite(doc.id)
- if (doc.perfd==0) {
- doc.perfd = "None";
- doc.avg = "None";
- doc.latest = "None";
+ if (doc.avgs.perfd==0) {
+ doc.avgs.perfd = "None";
+ doc.avgs.avg = "None";
+ doc.avgs.latest = "None";
}
send(mustache.to_html(ddoc.templates.listline,doc))
}
View
2  templates/listline.html
@@ -2,8 +2,10 @@
<td><a href={{link}}>{{id}}</a></td>
<td>{{name}}</td>
<td>{{venue}}</td>
+ {{#avgs}}
<td>{{latest}}</td>
<td>{{avg}}</td>
+ {{/avgs}}
{{#guess}}
<td>{{box}}</td>
<td>{{usher}}</td>
View
2  views/shows/map.js
@@ -4,6 +4,6 @@ function(doc) {
avgs = calc.avg(doc)
guess = calc.guess(doc,avgs)
- emit(doc.venue,{"name":doc.name, "avg": avgs.avg, "latest": avgs.latest, "perfd": avgs.perfd, "id": doc._id,"guess":guess})
+ emit(doc.venue,{"name":doc.name, "avgs": avgs, "id": doc._id,"guess":guess})
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.