button to mark all entries up to there

This commit is contained in:
Athou
2013-07-08 01:27:58 +02:00
parent 4f92dece06
commit d6e63ff66d
7 changed files with 91 additions and 0 deletions

View File

@@ -752,6 +752,29 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
});
};
$scope.markUpTo = function(entry) {
var entries = [];
for (var i = 0; i < $scope.entries.length; i++) {
var entry = $scope.entries[i];
if (!entry.read) {
entries.push({
id : entry.id,
feedId : entry.feedId,
read: true
});
entry.read = true;
}
if (entry == $scope.current) {
break;
}
}
EntryService.markMultiple({
requests : entries
}, function() {
CategoryService.refresh();
});
};
$scope.star = function(entry, star, event) {
if (event) {
event.preventDefault();

View File

@@ -241,6 +241,12 @@ function($resource, $http) {
_method : 'mark'
}
},
markMultiple : {
method : 'POST',
params : {
_method : 'markMultiple'
}
},
star : {
method : 'POST',
params : {

View File

@@ -180,6 +180,17 @@
font-size: 12px;
}
#feed-accordion a.mark-up-to {
color: #333333;
position: absolute;
right: 30px;
}
#feed-accordion a.mark-up-to:hover {
text-decoration: none;
cursor: pointer;
}
#feed-accordion .star {
text-decoration: none;
padding: 0px 5px;

View File

@@ -101,6 +101,10 @@
<i class="icon-buffer"></i>
</a>
</span>
<a ng-click="markUpTo(entry)" class="mark-up-to" title="${view.mark_up_to_here}">
<i class="icon-step-forward icon-rotate-90"></i>
</a>
</div>
</div>
</div>