Replace stats intialization on backlog with 'default' filter.
parent
3306af6052
commit
4d0c35fc56
|
@ -32,15 +32,6 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
|
||||
@rootscope.$on("usform:bulk:success", @.loadUserstories)
|
||||
|
||||
initializeProjectStats: ->
|
||||
@scope.stats = {
|
||||
total_points: "--"
|
||||
defined_points: "--"
|
||||
assigned_points: "--"
|
||||
closed_points: "--"
|
||||
completedPercentage: "--%"
|
||||
}
|
||||
|
||||
loadProjectStats: ->
|
||||
return @rs.projects.stats(@scope.projectId).then (stats) =>
|
||||
@scope.stats = stats
|
||||
|
@ -76,9 +67,6 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
return project
|
||||
|
||||
loadInitialData: ->
|
||||
# Set stats initial values
|
||||
@.initializeProjectStats()
|
||||
|
||||
# Resolve project slug
|
||||
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
||||
@scope.projectId = data.project
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
###
|
||||
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
|
||||
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
|
||||
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File: modules/common/filters.coffee
|
||||
###
|
||||
|
||||
|
||||
defaultFilter = ->
|
||||
return (value, defaultValue) ->
|
||||
if not value
|
||||
return defaultValue
|
||||
return value
|
||||
|
||||
module = angular.module("taigaCommon")
|
||||
module.filter("default", defaultFilter)
|
||||
|
|
@ -6,14 +6,14 @@ div.summary(tg-backlog-summary)
|
|||
span.description completed
|
||||
ul
|
||||
li
|
||||
span.number(ng-bind="stats.total_points")
|
||||
span.number(ng-bind="stats.total_points|default:'--'")
|
||||
span.description project<br />points
|
||||
li
|
||||
span.number(ng-bind="stats.defined_points")
|
||||
span.number(ng-bind="stats.defined_points|default:'--'")
|
||||
span.description defined<br />points
|
||||
li
|
||||
span.number(ng-bind="stats.assigned_points")
|
||||
span.number(ng-bind="stats.assigned_points|default:'--'")
|
||||
span.description assigned<br />points
|
||||
li
|
||||
span.number(ng-bind="stats.closed_points")
|
||||
span.number(ng-bind="stats.closed_points|default:'-- %'")
|
||||
span.description closed<br />points
|
||||
|
|
Loading…
Reference in New Issue