Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

and the files I added for all the reports we used.

  • Loading branch information...
commit 5f72c8c11f8b6b985ac33abdcfde79b5d1b64e30 1 parent 26555f6
@cdcarter authored
View
23 lists/hmreport.js
@@ -0,0 +1,23 @@
+function(head,req) {
+ var ddoc = this;
+ var mustache = require("vendor/couchapp/lib/mustache");
+ var path = require("vendor/couchapp/lib/path").init(req);
+ var row;
+ var data = {rows: []};
+
+ start({'headers': {'Content-Type':"text/html"}});
+
+ while(row=getRow()) {
+ var zz = {};
+ zz.venue = row.key[0]
+ zz.slot = row.key[1]
+ zz.count = row.value[0]
+ zz.name = row.value[1]
+ zz.id = row.value[2]
+ data.rows.push(zz)
+ };
+
+ data.venue = data.rows[0].venue
+
+ send(mustache.to_html(ddoc.templates.hmreport,data))
+}
View
23 lists/predictions.js
@@ -0,0 +1,23 @@
+function(head,req) {
+ var ddoc = this;
+ var mustache = require("vendor/couchapp/lib/mustache");
+ var path = require("vendor/couchapp/lib/path").init(req);
+ var row;
+
+ start({'headers': {'Content-Type':"text/html"}});
+
+ send("<!doctype html><html><head><title>HouseCounter Web</title></head><body><h1>Predictions</h1>")
+
+ send("<table><tr><th>Slot</th><th>Venue</th><th>Name</th><th>Prediction</th></tr>")
+
+ while(row=getRow()) {
+ var data = {};
+ data.slot = ddoc.data.slots[row.key[0]];
+ data.venue = row.key[1];
+ data.title = row.key[2];
+ data.prediction = row.value.toFixed(2)
+ send(mustache.to_html("<tr><td>{{slot}}</td><td>{{venue}}</td><td>{{title}}</td><td>{{prediction}}</td></tr>",data))
+ }
+
+ send("</table></body></html>")
+}
View
26 lists/slotindepth.js
@@ -0,0 +1,26 @@
+function(head,req) {
+ var ddoc = this;
+ var mustache = require("vendor/couchapp/lib/mustache");
+ var path = require("vendor/couchapp/lib/path").init(req);
+ var row;
+ var data = {rows: []};
+
+ start({'headers': {'Content-Type':"text/html"}});
+
+ while(row=getRow()) {
+ var zz = {};
+ zz.slot = row.key[0];
+ zz.venue = row.key[1];
+ zz.count = row.value;
+ zz.id = row.id;
+ zz.link = path.rewrite(zz.id)
+ data.rows.push(zz);
+ };
+
+ data.slotreport = path.rewrite("slots");
+ data.showlist = path.rewrite("")
+ data.time = ddoc.data.slots[data.rows[0].slot];
+ data.slot = data.rows[0].slot;
+
+ send(mustache.to_html(ddoc.templates.slotindepth,data))
+}
View
19 lists/slotreport.js
@@ -0,0 +1,19 @@
+function(head,req) {
+ var ddoc = this;
+ var mustache = require("vendor/couchapp/lib/mustache");
+ var path = require("vendor/couchapp/lib/path").init(req);
+ var row;
+ var data = {rows: []};
+
+ start({'headers': {'Content-Type':"text/html"}});
+
+ while(row=getRow()) {
+ var zz = row.value
+ zz.slot = row.key[0]
+ zz.percent = zz.percent.toFixed(2)
+ zz.link = path.rewrite("slots",zz.slot.toString())
+ data.rows.push(zz)
+ };
+
+ send(mustache.to_html(ddoc.templates.slotreport,data))
+}
View
16 templates/hmreport.html
@@ -0,0 +1,16 @@
+<!doctype html>
+
+<html>
+<head>
+ <title>HouseCounter HM Report</title>
+</head>
+
+<body>
+ <h1>HM Report: {{venue}}</h1>
+ <table>
+ {{#rows}}
+ <tr><th>{{id}}</th><td>{{name}}</td><td><input name="{{id}}-{{slot}}" value={{count}}></td></tr>
+ {{/rows}}
+ </table>
+</body>
+</html>
View
17 templates/slotindepth.html
@@ -0,0 +1,17 @@
+<!doctype html>
+
+<html>
+<head>
+ <title>HouseCounter Web</title>
+</head>
+<body>
+ <h1>Slot Report: {{time}} ({{slot}})</h1>
+ <table>
+ <tr><th>Venue</th><th>Count</th><th>Show ID</th></tr>
+ {{#rows}}
+ <tr><td>{{venue}}</td><td>{{count}}</td><td><a href="{{link}}">{{id}}</a></td></tr>
+ {{/rows}}
+ </table>
+ <a href="{{slotreport}}">Slot Report</a> | <a href="{{showlist}}">Show List</a>
+</body>
+</html>
View
14 templates/slotreport.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+<head>
+ <title>HouseCounter: Slot Report</title>
+</head>
+<body>
+ <h1>Slot Report</h1>
+ <table>
+ <tr><th>Slot</th><th>Complete</th><th>Percent</th></tr>
+ {{#rows}}
+ <tr><td><a href="{{link}}">{{slot}}</td><td>{{complete}}</td><td>{{percent}}</td></tr>
+ {{/rows}}
+ </table>
+</body>
View
9 views/bigassschedule/map.js
@@ -0,0 +1,9 @@
+function(doc) {
+ if (doc.type == "show") {
+ var calc = require("views/lib/showmath").init()
+ var prediction = calc.predict(doc);
+ for (var i = 0, _len = doc.shows.length; i < _len; i++) {
+ emit([doc.shows[i].slot,doc.venue,doc.name],prediction)
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.