diff --git a/app/coffee/modules/common/tags.coffee b/app/coffee/modules/common/tags.coffee index cb38eee9..377b795e 100644 --- a/app/coffee/modules/common/tags.coffee +++ b/app/coffee/modules/common/tags.coffee @@ -58,47 +58,33 @@ TagsDirective = -> module.directive("tgTags", TagsDirective) -ColorizeTagsDirective = -> - templates = { - backlog: _.template(""" +ColorizeTagsBacklogDirective = -> + template = _.template(""" <% _.each(tags, function(tag) { %> + <% if (tag[1] !== null) { %> - style="border-left: 5px solid <%- tag[1] %>" - <% } %> - title="<%- tag[0] %>"><%- tag[0] %> + style="border-left: 5px solid <%- tag[1] %>" + title="<%- tag[0] %>"> + <%- tag[0] %> + + <% } %> <% }) %> - """) - kanban: _.template(""" <% _.each(tags, function(tag) { %> - - style="border-color: <%- tag[1] %>" - <% } %> - title="<%- tag[0] %>" /> + <% if (tag[1] === null) { %> + + <%- tag[0] %> + + <% } %> <% }) %> - """) - taskboard: _.template(""" - <% _.each(tags, function(tag) { %> - - style="border-color: <%- tag[1] %>" - <% } %> - title="<%- tag[0] %>" /> - <% }) %> - """) - } + """) link = ($scope, $el, $attrs, $ctrl) -> render = (tags) -> - template = templates[$attrs.tgColorizeTagsType] - html = template({tags: tags}) $el.html(html) - $scope.$watch $attrs.tgColorizeTags, (tags) -> + $scope.$watch $attrs.tgColorizeBacklogTags, (tags) -> render(tags) if tags? $scope.$on "$destroy", -> @@ -106,7 +92,7 @@ ColorizeTagsDirective = -> return {link: link} -module.directive("tgColorizeTags", ColorizeTagsDirective) +module.directive("tgColorizeBacklogTags", ColorizeTagsBacklogDirective) ############################################################################# diff --git a/app/partials/includes/components/backlog-row.jade b/app/partials/includes/components/backlog-row.jade index 08524602..e3fafd2d 100644 --- a/app/partials/includes/components/backlog-row.jade +++ b/app/partials/includes/components/backlog-row.jade @@ -17,7 +17,7 @@ tg-svg(svg-icon="icon-upvote") span {{ ::us.total_voters }} .user-stories - .tags-block(tg-colorize-tags="us.tags", tg-colorize-tags-type="backlog") + .tags-block(tg-colorize-backlog-tags="us.tags") .user-story-name a.clickable( href=""