diff --git a/src/main/java/com/commafeed/frontend/model/request/MarkRequest.java b/src/main/java/com/commafeed/frontend/model/request/MarkRequest.java index c057d84a..28600eca 100644 --- a/src/main/java/com/commafeed/frontend/model/request/MarkRequest.java +++ b/src/main/java/com/commafeed/frontend/model/request/MarkRequest.java @@ -21,7 +21,7 @@ public class MarkRequest implements Serializable { @ApiProperty(value = "mark as read or unread") private boolean read; - @ApiProperty(value = "only entries older than this, prevent marking an entry that was not retrieved", required = false) + @ApiProperty(value = "only entries older than this, pass the timestamp you got from the entry list to prevent marking an entry that was not retrieved", required = false) private Long olderThan; public String getId() { diff --git a/src/main/resources/i18n/en.properties b/src/main/resources/i18n/en.properties index 7e8e62ea..4b24e32f 100644 --- a/src/main/resources/i18n/en.properties +++ b/src/main/resources/i18n/en.properties @@ -25,7 +25,11 @@ new_category.parent=Parent toolbar.unread=Unread toolbar.all=All toolbar.refresh=Refresh +toolbar.sort_by_asc_desc=Sort by date asc/desc toolbar.mark_all_as_read=Mark all as read +toolbar.mark_all_older_day=Items older than a day +toolbar.mark_all_older_week=Items older than a week +toolbar.mark_all_older_two_weeks=Items older than two weeks toolbar.settings=Settings toolbar.profile=Profile toolbar.admin=Admin diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 144b4255..1ee6f6ce 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -390,13 +390,31 @@ function($scope, $http, $state, $stateParams, $route, $location, $scope.$emit('emitReload'); }; - $scope.markAllAsRead = function() { + + var markAll = function(olderThan) { $scope.$emit('emitMarkAll', { type : $stateParams._type, id : $stateParams._id, + olderThan: olderThan, read : true }); }; + + $scope.markAllAsRead = function() { + markAll(); + }; + + $scope.markAllDay = function() { + markAll(new Date().getTime() - 86400000); + }; + + $scope.markAllWeek = function() { + markAll(new Date().getTime() - 604800000); + }; + + $scope.markAllTwoWeeks = function() { + markAll(new Date().getTime() - 1209600000); + }; $scope.keywords = $stateParams._keywords; $scope.search = function() { @@ -531,12 +549,12 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer } }; - $scope.markAll = function() { + $scope.markAll = function(olderThan) { var service = $scope.selectedType == 'feed' ? FeedService : CategoryService; service.mark({ id : $scope.selectedId, - olderThan : $scope.timestamp, + olderThan : olderThan || $scope.timestamp, read : true }, function() { CategoryService.init(function() { @@ -714,7 +732,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer }); $scope.$on('markAll', function(event, args) { - $scope.markAll(); + $scope.markAll(args.olderThan); }); $scope.$on('reload', function(event, args) { diff --git a/src/main/webapp/templates/_toolbar.html b/src/main/webapp/templates/_toolbar.html index a467014b..2cc2dd22 100644 --- a/src/main/webapp/templates/_toolbar.html +++ b/src/main/webapp/templates/_toolbar.html @@ -6,20 +6,31 @@ - +
- - + +
- - - + +
- ${toolbar.settings} + + + +
+ +
+