Skip to content

Commit

Permalink
label utility/fun correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Visnu Pitiyanuvath committed Aug 6, 2011
1 parent af19125 commit 6875707
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions models/vote.coffee
Expand Up @@ -38,6 +38,12 @@ VoteSchema.index { teamId: 1, updatedAt: -1 }


VoteSchema.static 'dimensions', VoteSchema.static 'dimensions',
[ 'utility', 'design', 'innovation', 'completeness' ] [ 'utility', 'design', 'innovation', 'completeness' ]
VoteSchema.static 'label', (dimension) ->
switch dimension
when 'utility' then 'Utility/Fun'
when 'design' then 'Design'
when 'innovation' then 'Innovation'
when 'completeness' then 'Completeness'


# associations # associations
VoteSchema.static 'people', (votes, next) -> VoteSchema.static 'people', (votes, next) ->
Expand Down
2 changes: 1 addition & 1 deletion views/votes/form.jade
Expand Up @@ -25,7 +25,7 @@
table table
tr tr
- each d in Vote.dimensions - each d in Vote.dimensions
th: label( for: d )= d th: label( for: d )= Vote.label(d)
tr tr
- each d in Vote.dimensions - each d in Vote.dimensions
td: input( name: d, id: d, type: 'range', min: 0, max: 5, value: 0 ) td: input( name: d, id: d, type: 'range', min: 0, max: 5, value: 0 )
Expand Down
2 changes: 1 addition & 1 deletion views/votes/vote.jade
Expand Up @@ -10,7 +10,7 @@ li.vote
table table
tr tr
- each d in Vote.dimensions - each d in Vote.dimensions
th: label( for: d )= d th: label( for: d )= Vote.label(d)
tr tr
- each d in Vote.dimensions - each d in Vote.dimensions
td: input( name: d, id: d, type: 'range', min: 0, max: 5, value: vote[d] ) td: input( name: d, id: d, type: 'range', min: 0, max: 5, value: vote[d] )
Expand Down

0 comments on commit 6875707

Please sign in to comment.