filter by issue type

stable
Juanfran 2014-08-08 13:06:39 +02:00
parent 0e8e3f5788
commit 18d5fd0427
2 changed files with 16 additions and 1 deletions

View File

@ -176,6 +176,16 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
obj.selected = true if isSelected("tags", obj.id)
return obj
@scope.filters.types = _.map data.types, (t) =>
obj = {
id: t[0],
name: @scope.issueTypeById[t[0]].name,
color: @scope.issueTypeById[t[0]].color
count: t[1],
type: "types"
}
obj.selected = true if isSelected("types", obj.id)
return obj
@rootscope.$broadcast("filters:loaded", @scope.filters)
return data
@ -200,6 +210,8 @@ class IssuesController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.Fi
name = "assigned_to"
else if name == "statuses"
name = "status"
else if name == "types"
name = "type"
@scope.httpParams[name] = values
promise = @rs.issues.list(@scope.projectId, @scope.httpParams).then (data) =>
@ -512,7 +524,6 @@ IssuesFiltersDirective = ($log, $location) ->
event.preventDefault()
target = angular.element(event.currentTarget)
tags = $scope.filters[target.data("type")]
renderFilters(_.reject(tags, "selected"))
showFilters(target.attr("title"), target.data("type"))

View File

@ -13,6 +13,10 @@ section.filters
span.title status
div.filters-cats
ul
li
a(href="", title="Type", data-type="types")
span.title Type
span.icon.icon-arrow-right
li
a(href="", title="Status", data-type="statuses")
span.title Status