toggle between unread and all entries

This commit is contained in:
Athou
2013-03-23 17:56:19 +01:00
parent 84e4751e07
commit 1871fa1169
4 changed files with 38 additions and 12 deletions

View File

@@ -86,12 +86,18 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
$scope.selectedType = $routeParams._type;
$scope.selectedId = $routeParams._id;
$scope.entryList = EntryService.get({
_type : $scope.selectedType,
_id : $scope.selectedId,
_readtype : 'unread'
})
$scope.readType = 'all';
$scope.refreshList = function() {
$scope.entryList = EntryService.get({
_type : $scope.selectedType,
_id : $scope.selectedId,
_readtype : $scope.readType
});
};
$scope.refreshList();
$scope.mark = function(entry, read) {
if (entry.read != read) {
entry.read = read;

View File

@@ -1,4 +1,14 @@
<div ng-controller="FeedListCtrl">
<div class="toolbar">
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" class="btn" ng-model="readType" btn-radio="'all'" ng-click="refreshList()">All</button>
<button type="button" class="btn" ng-model="readType" btn-radio="'unread'" ng-click="refreshList()">Unread only</button>
</div>
</div>
<span>{{entryList.name}}</span><span
ng-show="selectedType == 'category'"> &#187;</span>
<div class="accordion" id="feed-accordion">