Starting to work in new progress bar for backlog
parent
893f4ede7d
commit
948439e49f
|
@ -968,3 +968,34 @@ tgBacklogGraphDirective = ->
|
||||||
|
|
||||||
|
|
||||||
module.directive("tgGmBacklogGraph", tgBacklogGraphDirective)
|
module.directive("tgGmBacklogGraph", tgBacklogGraphDirective)
|
||||||
|
|
||||||
|
|
||||||
|
#############################################################################
|
||||||
|
## Backlog progress bar directive
|
||||||
|
#############################################################################
|
||||||
|
|
||||||
|
TgBacklogProgressBarDirective = ->
|
||||||
|
template = _.template("""
|
||||||
|
<div class="defined-points-progress" style="width: 100%; background: red; height: 24px; position: absolute; "></div>
|
||||||
|
<div class="project-points" style="width: 80%; background: gray; height: 24px; position: absolute; "></div>
|
||||||
|
<div class="project-points-progress" style="width: <%- percentage %>%; height: 24px; position: absolute; background: green"></div>
|
||||||
|
<!--<div class="current-progress" style="width: <%- percentage %>%"></div>-->
|
||||||
|
""")
|
||||||
|
|
||||||
|
render = (el, percentage) ->
|
||||||
|
el.html(template({percentage: percentage}))
|
||||||
|
|
||||||
|
link = ($scope, $el, $attrs) ->
|
||||||
|
element = angular.element($el)
|
||||||
|
|
||||||
|
$scope.$watch $attrs.tgBacklogProgressBar, (percentage) ->
|
||||||
|
percentage = _.max([0 , percentage])
|
||||||
|
percentage = _.min([100, percentage])
|
||||||
|
render($el, percentage)
|
||||||
|
|
||||||
|
$scope.$on "$destroy", ->
|
||||||
|
$el.off()
|
||||||
|
|
||||||
|
return {link: link}
|
||||||
|
|
||||||
|
module.directive("tgBacklogProgressBar", TgBacklogProgressBarDirective)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
div.summary
|
div.summary
|
||||||
div.summary-progress-bar(tg-progress-bar="stats.completedPercentage")
|
div.summary-progress-bar(tg-backlog-progress-bar="stats.completedPercentage")
|
||||||
div.current-progress(style="width: {{stats.completedPercentage}}")
|
div.current-progress(style="width: {{stats.completedPercentage}}")
|
||||||
div.data
|
div.data
|
||||||
span.number(tg-bind-html="stats.completedPercentage + '%'")
|
span.number(tg-bind-html="stats.completedPercentage + '%'")
|
||||||
|
@ -10,9 +10,9 @@ div.summary
|
||||||
li
|
li
|
||||||
span.number(tg-bind-html="stats.defined_points") --
|
span.number(tg-bind-html="stats.defined_points") --
|
||||||
span.description defined<br />points
|
span.description defined<br />points
|
||||||
li
|
|
||||||
span.number(tg-bind-html="stats.assigned_points") --
|
|
||||||
span.description assigned<br />points
|
|
||||||
li
|
li
|
||||||
span.number(tg-bind-html="stats.closed_points") --
|
span.number(tg-bind-html="stats.closed_points") --
|
||||||
span.description closed<br />points
|
span.description closed<br />points
|
||||||
|
li
|
||||||
|
span.number(tg-bind-html="stats.speed") --
|
||||||
|
span.description points /<br />sprint
|
||||||
|
|
Loading…
Reference in New Issue