Merge pull request #133 from taigaio/bug/1492/sort-tags-alphabetically-in-backlog

Sorting tags alphabetically in backlog
stable
David Barragán Merino 2014-10-30 18:57:58 +01:00
commit 2f01e2b161
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}