challenges: fix dynamic user-challenge score

This commit is contained in:
Tyler Renelle 2013-06-02 22:37:59 -04:00
parent f92ef99355
commit c47291fe7c
2 changed files with 6 additions and 1 deletions

View file

@ -205,3 +205,7 @@ module.exports.viewHelpers = (view) ->
taskInChallenge.call(@,task)?.get(attr)
view.fn 'brokenChallengeLink', (task) ->
task?.challenge and !(taskInChallenge.call(@,task)?.get())
view.fn 'challengeMemberScore', (member, tType, tid) ->
Math.round(member["#{tType}s"]?[tid]?.value)

View file

@ -149,7 +149,8 @@
{#each @challenge[@taskType]s as :task}
<table><tr>
<td>
<strong>{:task.text}</strong>: {round(@member[@taskType]s[:task.id].value)}
<!-- FIXME commented section below isn't getting updated dynamically, temp solution is less efficient -->
<strong>{:task.text}</strong>: {challengeMemberScore(@member,@taskType,:task.id)} <!--{round(@member[@taskType]s[:task.id].value)}-->
</td>
<td>
<div style='margin-left: 10px' class="challenge-{{@challenge.id}}-member-{{@member.id}}-history-{{:task.id}}"></div>