Implementing searches.
parent
5aa976e931
commit
4bea40d909
|
@ -156,6 +156,24 @@ ListItemIssueStatusDirective = ->
|
|||
return {link:link}
|
||||
|
||||
|
||||
ListItemTaskStatusDirective = ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
task = $scope.$eval($attrs.tgListitemTaskStatus)
|
||||
bindOnce $scope, "taskStatusById", (taskStatusById) ->
|
||||
$el.html(taskStatusById[task.status].name)
|
||||
|
||||
return {link:link}
|
||||
|
||||
|
||||
ListItemUsStatusDirective = ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
us = $scope.$eval($attrs.tgListitemUsStatus)
|
||||
bindOnce $scope, "usStatusById", (usStatusById) ->
|
||||
$el.html(usStatusById[us.status].name)
|
||||
|
||||
return {link:link}
|
||||
|
||||
|
||||
ListItemAssignedtoDirective = ->
|
||||
template = """
|
||||
<figure class="avatar">
|
||||
|
@ -232,4 +250,5 @@ module.directive("tgListitemIssueStatus", ListItemIssueStatusDirective)
|
|||
module.directive("tgListitemAssignedto", ListItemAssignedtoDirective)
|
||||
module.directive("tgListitemPriority", ListItemPriorityDirective)
|
||||
module.directive("tgListitemSeverity", ListItemSeverityDirective)
|
||||
|
||||
module.directive("tgListitemTaskStatus", ListItemTaskStatusDirective)
|
||||
module.directive("tgListitemUsStatus", ListItemUsStatusDirective)
|
||||
|
|
|
@ -34,9 +34,16 @@ module = angular.module("taigaSearch", [])
|
|||
#############################################################################
|
||||
|
||||
class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||
@.$inject = ["$scope", "$tgRepo", "$tgResources", "$routeParams", "$q"]
|
||||
@.$inject = [
|
||||
"$scope",
|
||||
"$tgRepo",
|
||||
"$tgResources",
|
||||
"$routeParams",
|
||||
"$q",
|
||||
"$location"
|
||||
]
|
||||
|
||||
constructor: (@scope, @repo, @rs, @params, @q) ->
|
||||
constructor: (@scope, @repo, @rs, @params, @q, @location) ->
|
||||
@scope.sectionName = "Search"
|
||||
|
||||
promise = @.loadInitialData()
|
||||
|
@ -60,11 +67,11 @@ class SearchController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
return @rs.projects.get(@scope.projectId).then (project) =>
|
||||
@scope.project = project
|
||||
@scope.issueStatusById = groupBy(project.issue_statuses, (x) -> x.id)
|
||||
@scope.taskStatusById = groupBy(project.task_statuses, (x) -> x.id)
|
||||
@scope.severityById = groupBy(project.severities, (x) -> x.id)
|
||||
@scope.priorityById = groupBy(project.priorities, (x) -> x.id)
|
||||
@scope.membersById = groupBy(project.memberships, (x) -> x.user)
|
||||
@scope.usStatusById = groupBy(project.us_statuses, (x) -> x.id)
|
||||
# @scope.usStatusList = _.sortBy(project.us_statuses, "id")
|
||||
return project
|
||||
|
||||
loadSearchData: (term) ->
|
||||
|
|
|
@ -11,8 +11,8 @@ script(type="text/ng-template", id="search-issues")
|
|||
div.user-stories.width-6
|
||||
div.user-story-name
|
||||
a(href="", tg-bo-html="issue.subject")
|
||||
div.status.width-2(tg-issue-status="issue")
|
||||
div.points.width-1(tg-issue-assignedto="issue")
|
||||
div.status.width-2(tg-listitem-issue-status="issue")
|
||||
div.points.width-1(tg-listitem-assignedto="issue")
|
||||
|
||||
script(type="text/ng-template", id="search-userstories")
|
||||
div.search-result-table-header
|
||||
|
@ -25,21 +25,19 @@ script(type="text/ng-template", id="search-userstories")
|
|||
div.user-stories.width-4
|
||||
div.user-story-name
|
||||
a(href="", tg-bo-html="us.subject")
|
||||
div.status.width-2 Status
|
||||
div.points.width-1 12
|
||||
div.status.width-2(tg-listitem-us-status="us")
|
||||
div.points.width-1(tg-bo-html="us.total_points")
|
||||
|
||||
script(type="text/ng-template", id="search-tasks")
|
||||
div.search-result-table-header
|
||||
div.row.title
|
||||
div.user-stories.width-4 Tasks
|
||||
div.user-stories.width-4 Task
|
||||
div.status.width-2 Status
|
||||
div.points.width-1 Points
|
||||
div.points.width-1 Sprints
|
||||
div.points.width-1 Assigned to
|
||||
div.search-result-table-body
|
||||
div.row.table-main(ng-repeat="task in tasks track by task.id")
|
||||
div.user-stories.width-4
|
||||
div.user-story-name
|
||||
a(href="", tg-bo-html="task.subject")
|
||||
div.status.width-2 Status
|
||||
div.points.width-1 12
|
||||
div.points.width-1 54
|
||||
div.status.width-2(tg-listitem-task-status="task")
|
||||
div.points.width-1(tg-listitem-assignedto="task")
|
||||
|
|
Loading…
Reference in New Issue