diff --git a/app/coffee/modules/userstories/detail.coffee b/app/coffee/modules/userstories/detail.coffee
index 66781b18..e932989f 100644
--- a/app/coffee/modules/userstories/detail.coffee
+++ b/app/coffee/modules/userstories/detail.coffee
@@ -117,6 +117,7 @@ class UserStoryDetailController extends mixOf(taiga.Controller, taiga.PageMixin)
.then(=> @.loadUsersAndRoles())
.then(=> @.loadUs())
+
block: ->
@rootscope.$broadcast("block", @scope.us)
@@ -194,12 +195,14 @@ UsStatusDetailDirective = () ->
<%= status.name %>
+ <% if (showTasks) { %>
<%- totalClosedTasks %>/<%- totalTasks %> tasks completed
+ <% } %>
@@ -283,8 +286,13 @@ UsStatusDetailDirective = () ->
val = "?" if not val?
v.points = val
- totalTasks = $scope.tasks.length
- totalClosedTasks = _.filter($scope.tasks, (task) => $scope.taskStatusById[task.status].is_closed).length
+ if $scope.tasks
+ totalTasks = $scope.tasks.length
+ totalClosedTasks = _.filter($scope.tasks, (task) => $scope.taskStatusById[task.status].is_closed).length
+ showTasks = true
+ else
+ showTasks = false
+
usProgress = 0
usProgress = 100 * totalClosedTasks / totalTasks if totalTasks > 0
html = template({
@@ -296,11 +304,18 @@ UsStatusDetailDirective = () ->
rolePoints: rolePoints
totalTasks: totalTasks
totalClosedTasks: totalClosedTasks
+ totalTasks: totalTasks
+ totalClosedTasks: totalClosedTasks
+ showTasks: showTasks
usProgress: usProgress
})
$el.html(html)
$el.find(".status-data").append(selectionStatusTemplate({statuses:$scope.statusList}))
+ $scope.$watch $attrs.ngModel, (us) ->
+ if us?
+ renderUsstatus(us)
+
bindOnce $scope, "tasks", (tasks) ->
$scope.$watch $attrs.ngModel, (us) ->
if us?