Skip to content

Commit

Permalink
Fix splits!
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-c committed Dec 12, 2012
1 parent b2ddf2b commit 084234f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/lib/splits.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ User = require 'zooniverse/lib/models/user'

userCount = -> User.current?.project.user_count or 0

none = -> ''
social = -> translate('classify.splits.social').replace '###', userCount()
task = -> translate 'classify.splits.task'
science = -> translate 'classify.splits.science'
Expand All @@ -18,8 +19,8 @@ lessThanThreeClassifications = -> countClassifications() <= 3

splits =
classifier_messaging:
a: body: '', isShown: oneClassification
b: body: '', isShown: lessThanThreeClassifications
a: body: none, isShown: oneClassification
b: body: none, isShown: lessThanThreeClassifications
c: body: social, isShown: oneClassification
d: body: social, isShown: lessThanThreeClassifications
e: body: task, isShown: oneClassification
Expand All @@ -33,7 +34,7 @@ get = (key) ->
if User.current?.project?.splits?[key]?
splitId = User.current.project.splits[key]
message = splits[key][splitId]
body = message.body {userCount} if message.isShown()
body = message.body() if message.isShown()

body

Expand Down

0 comments on commit 084234f

Please sign in to comment.