-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple paging #8
base: master
Are you sure you want to change the base?
Conversation
2 similar comments
3 similar comments
3 similar comments
lathermail/validators.py
Outdated
@@ -20,3 +20,5 @@ def iso_date(value): | |||
parser.add_argument("created_at_lt", type=iso_date) | |||
parser.add_argument("created_at_gt", type=iso_date) | |||
parser.add_argument("read", type=types.boolean) | |||
parser.add_argument("X-Mail-Offset", type=int, dest="offset", location="headers", default=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This arguments should be passed as query parameters, not headers.
@@ -90,6 +95,17 @@ lathermailApp.controller('lathermailCtrl', function ($scope, $http, $routeParams | |||
}); | |||
}; | |||
|
|||
$scope.getNextMessagesPage = function(direction) { | |||
if (direction === 'right') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right and left are bad names. Please use forward
backwards
@@ -90,6 +95,17 @@ lathermailApp.controller('lathermailCtrl', function ($scope, $http, $routeParams | |||
}); | |||
}; | |||
|
|||
$scope.getNextMessagesPage = function(direction) { | |||
if (direction === 'right') { | |||
$scope.messages.length < $scope.offsetStep ? $scope.offset += 0 : $scope.offset += $scope.offsetStep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single if
… change; change tests
Now only 10 messages per page will be shown in messages list.
...and only with SQLAlchemy yet.