Add untagged projects counter.

This commit is contained in:
Paulo Reis 2017-04-28 16:57:37 +01:00
parent 2d4c5f012a
commit 6e40284099
2 changed files with 11 additions and 2 deletions

View file

@ -83,7 +83,11 @@
ng-if="tags.length",
ng-cloak,
ng-click="selectUntagged()"
) uncategorized
ng-class="{active: filter === 'untagged'}",
)
a.tag-untagged(href)
| #{translate("uncategorized")}
span.subdued ({{ nUntagged }})
li(ng-cloak)
a.tag(href, ng-click="openNewTagModal()")
i.fa.fa-fw.fa-plus

View file

@ -10,6 +10,7 @@ define [
$scope.selectedProjects = []
$scope.filter = "all"
$scope.predicate = "lastUpdated"
$scope.nUntagged = 0
$scope.reverse = true
$scope.searchText =
value : ""
@ -18,6 +19,10 @@ define [
recalculateProjectListHeight()
, 10
$scope.$watch((
() -> $scope.projects.filter((project) -> !project.tags? or project.tags.length == 0).length
), (newVal) -> $scope.nUntagged = newVal)
storedUIOpts = JSON.parse(localStorage("project_list"))
recalculateProjectListHeight = () ->
@ -114,7 +119,7 @@ define [
visible = false
# Hide tagged projects if we only want to see the uncategorized ones
if $scope.filter == "untagged" and project.tags?
if $scope.filter == "untagged" and project.tags?.length > 0
visible = false
# Hide projects we own if we only want to see shared projects