Created
June 9, 2014 01:34
-
-
Save cmosguy/7f7ae7f10b9e5756b23b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script type="text/x-handlebars" data-template-name="game"> | |
($game->game_status == 'live') | |
<div class="row"> | |
<div class="col-md-1"> | |
<span class="muted">Clock: {{game.gameclock}}</span> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-1"> | |
<img class="thumbnail" src="http://placehold.it/60x60" alt=""> | |
</div> | |
<div class="col-md-3"> | |
<span class="muted">{{{ $game->away()->first()->team }}}</span> | |
• | |
{{{ $game->away_score }}} | |
</div> | |
<div class="col-md-1"> | |
<img class="thumbnail" src="http://placehold.it/60x60" alt=""> | |
</div> | |
<div class="col-md-3"> | |
<span class="muted">{{{ $game->home()->first()->team }}}</span> | |
• | |
{{{ $game->home_score }}} | |
</div> | |
</div> | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var App = Ember.Application.create(); | |
App.Router.map(function () { | |
this.resource("game", { | |
"path": "/" | |
}); | |
}); | |
App.ApplicationAdapter = DS.FixtureAdapter.extend(); | |
App.Game = DS.Model.extend({ | |
//"id": DS.attr("integer"), | |
away_score: DS.attr("integer"), | |
home_score: DS.attr("integer"), | |
gameclock: DS.attr("string"), | |
game: DS.attr("string"), | |
game_status: DS.attr("string") | |
}); | |
App.Game.FIXTURES = [ | |
{ | |
id: 1, | |
away_score: 10, | |
home_score: 20, | |
gameclock: "6:66", | |
game: "test game.", | |
game_status : "live" | |
} | |
// { | |
// "id" : 2, | |
// "user" : "Wayne", | |
// "text" : "Don't dig it, man." | |
// }, | |
// { | |
// "id" : 3, | |
// "user" : "Chris", | |
// "text" : "Meh." | |
// } | |
]; | |
var store; | |
App.GameRoute = Ember.Route.extend({ | |
model : function () { | |
return this.store.find("game", 1); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment