Merge pull request #1187 from taigaio/issue-4827-ordering-of-tags
Issue 4827; ordering of tagsstable
commit
4d88daa6c6
|
@ -58,47 +58,33 @@ TagsDirective = ->
|
|||
module.directive("tgTags", TagsDirective)
|
||||
|
||||
|
||||
ColorizeTagsDirective = ->
|
||||
templates = {
|
||||
backlog: _.template("""
|
||||
ColorizeTagsBacklogDirective = ->
|
||||
template = _.template("""
|
||||
<% _.each(tags, function(tag) { %>
|
||||
<% if (tag[1] !== null) { %>
|
||||
<span class="tag"
|
||||
<% if (tag[1] !== null) { %>
|
||||
style="border-left: 5px solid <%- tag[1] %>"
|
||||
title="<%- tag[0] %>">
|
||||
<%- tag[0] %>
|
||||
</span>
|
||||
<% } %>
|
||||
title="<%- tag[0] %>"><%- tag[0] %></span>
|
||||
<% }) %>
|
||||
""")
|
||||
kanban: _.template("""
|
||||
<% _.each(tags, function(tag) { %>
|
||||
<a class="kanban-tag"
|
||||
href=""
|
||||
<% if (tag[1] !== null) { %>
|
||||
style="border-color: <%- tag[1] %>"
|
||||
<% if (tag[1] === null) { %>
|
||||
<span class="tag"
|
||||
title="<%- tag[0] %>">
|
||||
<%- tag[0] %>
|
||||
</span>
|
||||
<% } %>
|
||||
title="<%- tag[0] %>" />
|
||||
<% }) %>
|
||||
""")
|
||||
taskboard: _.template("""
|
||||
<% _.each(tags, function(tag) { %>
|
||||
<a class="taskboard-tag"
|
||||
href=""
|
||||
<% if (tag[1] !== null) { %>
|
||||
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)
|
||||
|
||||
|
||||
#############################################################################
|
||||
|
|
|
@ -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=""
|
||||
|
|
Loading…
Reference in New Issue