Sorting tags alphabetically in backlog

stable
Alejandro Alonso 2014-10-30 13:02:50 +01:00 committed by David Barragán Merino
parent 34eb0a94b0
commit fd61bf77af
2 changed files with 3 additions and 0 deletions

View File

@ -427,6 +427,8 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
@scope.filters = {} @scope.filters = {}
plainTags = _.flatten(_.filter(_.map(@scope.userstories, "tags"))) plainTags = _.flatten(_.filter(_.map(@scope.userstories, "tags")))
plainTags.sort()
@scope.filters.tags = _.map _.countBy(plainTags), (v, k) => @scope.filters.tags = _.map _.countBy(plainTags), (v, k) =>
obj = { obj = {
id: k, id: k,

View File

@ -76,6 +76,7 @@ ColorizeTagsDirective = ->
link = ($scope, $el, $attrs, $ctrl) -> link = ($scope, $el, $attrs, $ctrl) ->
render = (srcTags) -> render = (srcTags) ->
template = templates[$attrs.tgColorizeTagsType] template = templates[$attrs.tgColorizeTagsType]
srcTags.sort()
tags = _.map srcTags, (tag) -> tags = _.map srcTags, (tag) ->
color = $scope.project.tags_colors[tag] color = $scope.project.tags_colors[tag]
return {name: tag, color: color} return {name: tag, color: color}