-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from JGefroh/feature/tags
FEATURE: Added task tagging.
- Loading branch information
Showing
16 changed files
with
314 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ToDoListClient/src/app/modules/common/filters/TagFilter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Created by Joseph on 8/25/2014. | ||
*/ | ||
(function() { | ||
function TagFilter() { | ||
return function(tasks, tagsToFilterBy) { | ||
if (!tasks || !tagsToFilterBy) { | ||
return tasks; | ||
} | ||
|
||
if (tagsToFilterBy.length === 0) { | ||
return tasks; | ||
} | ||
|
||
return tasks.filter(function(task, index, array) { | ||
var isIncluded = false; | ||
angular.forEach(task.tags, function(taskTag, index) { | ||
angular.forEach(tagsToFilterBy, function(filterTag, index) { | ||
if (filterTag === taskTag) { | ||
isIncluded = true; | ||
} | ||
}); | ||
}); | ||
return isIncluded; | ||
}); | ||
}; | ||
} | ||
angular | ||
.module('jgefroh.FiltersModule') | ||
.filter('tagFilter', TagFilter); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<span data-ng-repeat="tag in task.tags" | ||
data-ng-bind="tag" | ||
data-ng-class="{'task-tag-inactive':tagsToFilterBy.indexOf(tag) === -1, | ||
'task-tag-active':tagsToFilterBy.indexOf(tag) !== -1}" | ||
class="badge task-tag"></span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Created by Joseph on 8/25/2014. | ||
*/ | ||
(function() { | ||
function TagDisplayDirective() { | ||
function TagDisplayDirectiveCtrl() { | ||
} | ||
return { | ||
restrict: 'A', | ||
scope: { | ||
task: '=', | ||
tagsToFilterBy: '=' | ||
}, | ||
templateUrl: 'TagDisplay.html', | ||
controller: [TagDisplayDirectiveCtrl] | ||
} | ||
} | ||
angular | ||
.module('ToDoList.TaskModule') | ||
.directive('tagDisplay', [TagDisplayDirective]); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.