Fix sorting of due dates

This commit is contained in:
raimund-schluessler 2014-04-28 22:30:42 +02:00
parent 34dd3b2aa5
commit db99ac41d3
5 changed files with 16 additions and 3 deletions

View file

@ -173,6 +173,12 @@ CollectionsModel, TasksBusinessLayer, $location) ->
@_$scope.loadMore = () ->
console.log('TODO')
@_$scope.sortDue = (task) ->
if task.due == null
return 'last'
else
return task.due
return new TasksController($scope, $window, $routeParams,
TasksModel, ListsModel, CollectionsModel, TasksBusinessLayer, $location)
]

View file

@ -869,6 +869,13 @@
this._$scope.loadMore = function() {
return console.log('TODO');
};
this._$scope.sortDue = function(task) {
if (task.due === null) {
return 'last';
} else {
return task.due;
}
};
}
return TasksController;

View file

@ -4,7 +4,7 @@
<text>{{ list.displayname }}</text>
</h2>
<ol class="tasks">
<li ng-animate="'animate'" ng-repeat="task in tasks | filter:{'calendarid':list.id} | filter:filterTasks(task) | orderBy:'due' | orderBy:'starred':true"
<li ng-animate="'animate'" ng-repeat="task in tasks | filter:{'calendarid':list.id} | filter:filterTasks(task) | orderBy:sortDue | orderBy:'starred':true"
class="task-item ui-draggable" rel="{{ task.id }}" ng-click="openDetails(task.id)" ng-class="{done: task.completed}" oc-drag-task stop-event="click">
<div class="task-body">
<a class="task-checkbox" name="toggleCompleted" ng-click="toggleCompleted(task.id)" stop-event="click">

View file

@ -4,7 +4,7 @@
<text>{{ day | day }}</text>
</h2>
<ol class="tasks">
<li ng-animate="'animate'" ng-repeat="task in tasks | taskAtDay:day | filter:{'completed':'false'} | orderBy:'due' | orderBy:'starred':true"
<li ng-animate="'animate'" ng-repeat="task in tasks | taskAtDay:day | filter:{'completed':'false'} | orderBy:sortDue | orderBy:'starred':true"
class="task-item ui-draggable" rel="{{ task.id }}" ng-click="openDetails(task.id)" ng-class="{done: task.completed}" oc-drag-task stop-event="click">
<div class="task-body">
<a class="task-checkbox" name="toggleCompleted" ng-click="toggleCompleted(task.id)" stop-event="click">

View file

@ -1,7 +1,7 @@
<div ng-switch-default>
<div class="grouped-tasks">
<ol class="tasks" rel="uncompleted" oc-drop-task>
<li ng-repeat="(id, task) in tasks | filter:{'calendarid':route.listID} | filter:{'completed':'false'} | filter:route.searchString | orderBy:'due' | orderBy:'starred':true"
<li ng-repeat="(id, task) in tasks | filter:{'calendarid':route.listID} | filter:{'completed':'false'} | filter:route.searchString | orderBy:sortDue | orderBy:'starred':true"
class="task-item ui-draggable" rel="{{ task.id }}" ng-click="openDetails(task.id)" ng-class="{done: task.completed}" oc-drag-task stop-event="click">
<div class="task-body">
<a class="task-checkbox" name="toggleCompleted" ng-click="toggleCompleted(task.id)" stop-event="click">