Skip to content

Commit

Permalink
the winners
Browse files Browse the repository at this point in the history
  • Loading branch information
Visnu Pitiyanuvath committed Sep 3, 2010
1 parent dcd22bb commit 3bedc10
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
13 changes: 12 additions & 1 deletion nodeko.coffee
Expand Up @@ -107,8 +107,19 @@ get /.*/, ->
get '/', ->
Team.count (error, teamCount) =>
@teamCount = teamCount
Team.all { validDeploy: true }, { deep: false, sort: [['score.overall', -1]], limit: 10 }, (error, teams) =>
@winners = [
['Overall', 'saber-tooth-moose-lion']
['Solo', 'rallarpojken']
['Utility', 'prague-js']
['Design', 'piston-hurricane']
['Innovation', 'starcraft-2-destroyed-my-marriage']
['Completeness', 'explorer-sox']
['Popularity', 'seattle-js']
]
Team.all { slug: {'$in': _.pluck(@winners, 1)} }, { deep: false }, (error, teams) =>
@teams = teams
@winners = _.map @winners, (w) =>
[ w[0], _.detect(@teams, (t) -> t.slug == w[1]) ]
@render 'index.html.haml'

get '/me', ->
Expand Down
2 changes: 2 additions & 0 deletions public/stylesheets/application.css
Expand Up @@ -401,6 +401,8 @@ aside#pullout {
border-bottom: 1px dotted #142229; }
.body.index .left {
color: #a80003; }
.body.index .score {
display: none; }

.body.teams-new ol, .body.teams-edit ol {
list-style-type: none;
Expand Down
2 changes: 2 additions & 0 deletions public/stylesheets/application.sass
Expand Up @@ -401,6 +401,8 @@ aside#pullout
:border-bottom 1px dotted $black
.left
:color $red
.score
:display none

.body.teams-new, .body.teams-edit
ol
Expand Down
19 changes: 6 additions & 13 deletions views/index.html.haml
@@ -1,16 +1,9 @@
%h1 Stay Tuned for Winners

%p
Voting is over. We've got some cleaning to do before we announce the
winners. Give us about a day.

%h1 Top 10

%ul.teams
- each team in ctx.teams
%li!= partial('teams/application.html.haml', { locals: { team: team } })
%p
!= 'Make sure to check out <a href="/teams">the full list</a> and vote!'
%h1 Winners
%p We&rsquo;re excited to announce the winners for the Node.js Knockout.
- each winner in ctx.winners
%h2= winner[0]
%ul.teams
%li!= partial('teams/application.html.haml', { locals: { team: winner[1] } })

%h1 What
%p
Expand Down

0 comments on commit 3bedc10

Please sign in to comment.