Refreshing number of sprints when creating a new one
parent
48568705cf
commit
f7ecb95485
|
@ -166,6 +166,10 @@ CreateBulkUserstoriesDirective = ($repo, $rs, $rootscope) ->
|
|||
|
||||
CreateSprint = ($repo, $rs, $rootscope) ->
|
||||
link = ($scope, $el, attrs) ->
|
||||
$scope.milestonesCounter = "--"
|
||||
bindOnce $scope, "stats", (stats) ->
|
||||
$scope.milestonesCounter = stats.milestones.length
|
||||
|
||||
submit = ->
|
||||
form = $el.find("form").checksley()
|
||||
if not form.validate()
|
||||
|
@ -173,6 +177,7 @@ CreateSprint = ($repo, $rs, $rootscope) ->
|
|||
|
||||
promise = $repo.create("milestones", $scope.sprint)
|
||||
promise.then (data) ->
|
||||
$scope.milestonesCounter += 1
|
||||
$el.addClass("hidden")
|
||||
$rootscope.$broadcast("sprintform:create:success", data)
|
||||
|
||||
|
@ -191,7 +196,7 @@ CreateSprint = ($repo, $rs, $rootscope) ->
|
|||
lastSprintNameDom = $el.find(".last-sprint-name")
|
||||
sprintName = $scope.sprints?[0].name
|
||||
if sprintName?
|
||||
lastSprintNameDom.text(" last sprint is <strong> #{sprintName} ;-) </strong>")
|
||||
lastSprintNameDom.html(" last sprint is <strong> #{sprintName} ;-) </strong>")
|
||||
|
||||
$el.on "click", ".close", (event) ->
|
||||
event.preventDefault()
|
||||
|
|
|
@ -4,7 +4,7 @@ section.sprints
|
|||
div.summary
|
||||
ul
|
||||
li
|
||||
span.number(tg-bo-html="stats.total_milestones") --
|
||||
span.number(ng-bind="milestonesCounter") --
|
||||
span.description <br/>sprints
|
||||
div.new-sprint
|
||||
a.button.button-green(ng-click="ctrl.addNewSprint()", href="", title="Add New US")
|
||||
|
|
Loading…
Reference in New Issue