parent
12a442de6c
commit
e9a3f4d83b
|
@ -828,8 +828,9 @@ UsPointsDirective = ($repo) ->
|
||||||
dom = $el.find("a > span.points-value")
|
dom = $el.find("a > span.points-value")
|
||||||
|
|
||||||
if roleId == null or numberOfRoles == 1
|
if roleId == null or numberOfRoles == 1
|
||||||
dom.text(us.total_points)
|
totalPoints = if us.total_points? then us.total_points else "?"
|
||||||
dom.parent().prop("title", us.total_points)
|
dom.text(totalPoints)
|
||||||
|
dom.parent().prop("title", totalPoints)
|
||||||
else
|
else
|
||||||
pointId = us.points[roleId]
|
pointId = us.points[roleId]
|
||||||
pointObj = $scope.pointsById[pointId]
|
pointObj = $scope.pointsById[pointId]
|
||||||
|
|
|
@ -210,7 +210,7 @@ UsEstimationDirective = ($rootScope, $repo, $confirm) ->
|
||||||
return $scope.project.my_permissions.indexOf("modify_us") != -1
|
return $scope.project.my_permissions.indexOf("modify_us") != -1
|
||||||
|
|
||||||
render = (us) ->
|
render = (us) ->
|
||||||
totalPoints = us.total_points or 0
|
totalPoints = if us.total_points? then us.total_points else "?"
|
||||||
computableRoles = _.filter($scope.project.roles, "computable")
|
computableRoles = _.filter($scope.project.roles, "computable")
|
||||||
|
|
||||||
roles = _.map computableRoles, (role) ->
|
roles = _.map computableRoles, (role) ->
|
||||||
|
@ -254,10 +254,15 @@ UsEstimationDirective = ($rootScope, $repo, $confirm) ->
|
||||||
$el.find(".pop-points-open").show()
|
$el.find(".pop-points-open").show()
|
||||||
|
|
||||||
calculateTotalPoints = (us) ->
|
calculateTotalPoints = (us) ->
|
||||||
values = _.map(us.points, (v, k) -> $scope.pointsById[v]?.value or 0)
|
values = _.map(us.points, (v, k) -> $scope.pointsById[v]?.value)
|
||||||
if values.length == 0
|
if values.length == 0
|
||||||
return "0"
|
return "0"
|
||||||
return _.reduce(values, (acc, num) -> acc + num)
|
|
||||||
|
notNullValues = _.filter(values, (v) -> v?)
|
||||||
|
if notNullValues.length == 0
|
||||||
|
return "?"
|
||||||
|
|
||||||
|
return _.reduce(notNullValues, (acc, num) -> acc + num)
|
||||||
|
|
||||||
$el.on "click", ".total.clickable", (event) ->
|
$el.on "click", ".total.clickable", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|
Loading…
Reference in New Issue