Permalink
Browse files

Using live data from 2013 for timing

  • Loading branch information...
1 parent 4dc770d commit 6a3ecd559b29d6c037a9432cfd60947d94e25f4e Jason Walsh committed Apr 20, 2014
Showing with 18 additions and 26 deletions.
  1. +2 −0 controllers/rush.js
  2. +8 −7 public/js/main.js
  3. +1 −12 public/templates/runner.mst
  4. +6 −6 views/home.jade
  5. +1 −1 views/layout.jade
View
@@ -3,6 +3,8 @@
* Home page.
*/
+var graph = require('fbgraph');
+
exports.rush = function(req, res) {
res.render('Rush', {
title: 'BostonRush'
View
@@ -1,21 +1,22 @@
$(document).ready(function() {
- window.model = {};
+ window.model = { runners: {}};
$.get(
'/data/marathon_2013.json',
function(data, code) {
- model.top = _.select(
+ model.runners.all = data;
+ model.runners.top = _.select(
data,
function(runner) {
- return parseInt(runner.overallPlace, 10) < 2;
+ return runner.name === 'Desisa, Lelisa';
})[0];
+ model.runners.top.firstName = model.runners.top.name.split(',')[1];
+ model.runners.top.lastName = model.runners.top.name.split(',')[0];
$.get('templates/runner.mst', function(template) {
- // $('.lead').html(Mustache.render(template, model.top));
+ $('#topRunner').html(Mustache.render(template, model.runners.top));
});
-
- console.log(model.top);
+ console.log(model);
});
-
});
@@ -1,12 +1 @@
-<p>
- {{name}}, {{age}} ({{bib}})
- <br/><i>{{city}}, {{state}}</i>
-
- <ul>
- <li>Overall: {{overallPlace}}</li>
- <li>Gender: {{genderPlace}}</li>
- <li>Division: {{divisionPlace}}</li>
- </ul>
-
- <br/><b>Rush to beat {{officialTime}}</b>
-</p>
+<span class="runner">{{firstName}} {{lastName}} (bib <b>{{bib}}</b>, with a time of <i>{{officialTime}}</i>)</span>
View
@@ -8,15 +8,15 @@ block content
i.fa.fa-facebook
| Sign in with Facebook
else
- p Enter your bib number to complete with Tom Davis from
- form(action='home')
+ p Enter your bib number or the bib number of a friend in the 2013 Boston Marathon or rush against <span id='topRunner'>Lelisa Desisa</span>.
+ form(method='get', action='/rush')
.input-group
span.input-group-btn
- button.btn.btn-default(type='button') Go!
- input.form-control(type='text', name='bib', value='Input your BIB number')
-
+ button.btn.btn-default(type='submit',onclick='window.location="/rush"') Go!
+ input.form-control(type='text', name='bib', value='2')
+
img(src='img/menfirstplace.jpg', style='margin: 40px 0 0; width: 100%;')
-
+
h1 Rush Lelisa Desisa!
p You'll be competing against the winner of the 2013 marathon. Let's see how you compare.
View
@@ -13,6 +13,6 @@ html
body
#wrap
include partials/navigation
- .container
+ .container(style='padding:0')
include partials/flash
block content

0 comments on commit 6a3ecd5

Please sign in to comment.