Make sprint progress bar more generic.

stable
Andrey Antukh 2014-06-24 16:06:58 +02:00
parent c4afd6d6ac
commit 24ad079d98
2 changed files with 44 additions and 1 deletions

View File

@ -39,12 +39,19 @@ DateRangeDirective = ->
SprintProgressBarDirective = ->
renderProgress = ($el, percentage) ->
if $el.is(".current-progress")
$el.css("width", "#{percentage}%")
else
$el.find(".current-progress").css("width", "#{percentage}%")
$el.find(".number").html("#{percentage} %")
link = ($scope, $el, $attrs) ->
bindOnce $scope, $attrs.tgSprintProgressbar, (sprint) ->
closedPoints = sprint.closed_points
totalPoints = sprint.total_points
percentage = Math.round(100 * (closedPoints/totalPoints))
$el.css("width", "#{percentage}%")
renderProgress($el, percentage)
return {link: link}

View File

@ -0,0 +1,36 @@
div.summary.large-summary
div.summary-progress-bar
div.current-progress
div.data
span.number 30%
span.description completed
ul
li
span.number 12
span.description project<br />points
li
span.number 23
span.description defined<br />points
li
span.number 12
span.description assigned<br />points
li
span.number 23
span.description closed<br />points
ul
li
span.icon.icon-bulk
span.number 73
span.description created<br />tasks
li
span.number 72
span.description closed<br />tasks
li
span.number 18
span.description remaining<br />tasks
ul
li
span.icon.icon-iocaine
span.number 10
span.description iocanie<br />doses