[Loudash migration] Fix Team stats
parent
ef8087774a
commit
3241a657dc
|
@ -110,15 +110,18 @@ class TeamController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.stats.totals = @scope.totals
|
@scope.stats.totals = @scope.totals
|
||||||
|
|
||||||
_processStat: (stat) ->
|
_processStat: (stat) ->
|
||||||
max = _.max(stat)
|
max = _.max(_.toArray(stat))
|
||||||
min = _.min(stat)
|
min = _.min(_.toArray(stat))
|
||||||
singleStat = _.map stat, (value, key) ->
|
|
||||||
|
singleStat = Object()
|
||||||
|
for own key, value of stat
|
||||||
if value == min
|
if value == min
|
||||||
return [key, 0.1]
|
singleStat[key] = 0.1
|
||||||
if value == max
|
else if value == max
|
||||||
return [key, 1]
|
singleStat[key] = 1
|
||||||
return [key, (value * 0.5) / max]
|
else
|
||||||
singleStat = _.object(singleStat)
|
singleStat[key] = (value * 0.5) / max
|
||||||
|
|
||||||
return singleStat
|
return singleStat
|
||||||
|
|
||||||
_processStats: (stats) ->
|
_processStats: (stats) ->
|
||||||
|
|
Loading…
Reference in New Issue