Minor scope vars name changes oon backlog.

stable
Andrey Antukh 2014-06-27 11:45:42 +02:00
parent eb3fc22626
commit 8e603223b2
2 changed files with 7 additions and 10 deletions

View File

@ -20,10 +20,13 @@
### ###
taiga = @.taiga taiga = @.taiga
mixOf = @.taiga.mixOf mixOf = @.taiga.mixOf
toggleText = @.taiga.toggleText toggleText = @.taiga.toggleText
scopeDefer = @.taiga.scopeDefer scopeDefer = @.taiga.scopeDefer
bindOnce = @.taiga.bindOnce bindOnce = @.taiga.bindOnce
groupBy = @.taiga.groupBy
class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin) class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin)
constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) -> constructor: (@scope, @rootscope, @repo, @confirm, @rs, @params, @q) ->
@ -77,15 +80,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin)
return @rs.projects.get(@scope.projectId).then (project) => return @rs.projects.get(@scope.projectId).then (project) =>
@scope.project = project @scope.project = project
@scope.points = _.sortBy(project.points, "order") @scope.points = _.sortBy(project.points, "order")
@scope.pointsById = {} @scope.pointsById = groupBy(project.points, (x) -> x.id)
for p in @scope.points @scope.usStatusById = groupBy(project.us_statuses, (x) -> x.id)
@scope.pointsById[p.id] = p @scope.usStatusList = _.sortBy(project.us_statuses, "id")
@scope.usStatusById = {}
for s in project.us_statuses
@scope.usStatusById[s.id] = s
@scope.statusList = _.sortBy(project.us_statuses, "id")
return project return project
loadInitialData: -> loadInitialData: ->

View File

@ -5,7 +5,7 @@ form
fieldset fieldset
input(type="text", ng-model="us.subject", tg-i18n="placeholder:common.subject", data-required="true") input(type="text", ng-model="us.subject", tg-i18n="placeholder:common.subject", data-required="true")
fieldset fieldset
select(ng-model="us.status", ng-options="s.id as s.name for s in statusList", select(ng-model="us.status", ng-options="s.id as s.name for s in usStatusList",
tg-i18n="placeholder:common.status") tg-i18n="placeholder:common.status")
fieldset fieldset
input(type="text", placeholder="Tags", tg-tags, ng-model="us.tags") input(type="text", placeholder="Tags", tg-tags, ng-model="us.tags")