diff --git a/src/main/java/com/commafeed/frontend/model/Subscription.java b/src/main/java/com/commafeed/frontend/model/Subscription.java
index 4bb637b9..91c5907b 100644
--- a/src/main/java/com/commafeed/frontend/model/Subscription.java
+++ b/src/main/java/com/commafeed/frontend/model/Subscription.java
@@ -8,6 +8,7 @@ public class Subscription implements Serializable {
private Long id;
private String name;
private String message;
+ private int errorCount;
private String feedUrl;
private long unread;
@@ -51,4 +52,12 @@ public class Subscription implements Serializable {
this.feedUrl = feedUrl;
}
+ public int getErrorCount() {
+ return errorCount;
+ }
+
+ public void setErrorCount(int errorCount) {
+ this.errorCount = errorCount;
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java b/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java
index 5f5b37a8..35484876 100644
--- a/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java
+++ b/src/main/java/com/commafeed/frontend/rest/resources/SubscriptionsREST.java
@@ -213,6 +213,7 @@ public class SubscriptionsREST extends AbstractREST {
sub.setId(subscription.getId());
sub.setName(subscription.getTitle());
sub.setMessage(subscription.getFeed().getMessage());
+ sub.setErrorCount(subscription.getFeed().getErrorCount());
sub.setFeedUrl(subscription.getFeed().getLink());
Long size = unreadCount.get(subscription.getId());
sub.setUnread(size == null ? 0 : size);
diff --git a/src/main/webapp/directives/category.html b/src/main/webapp/directives/category.html
index 24233e30..a5ad7a6a 100644
--- a/src/main/webapp/directives/category.html
+++ b/src/main/webapp/directives/category.html
@@ -1,6 +1,6 @@
-
diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js
index 6ce01266..948cbac7 100644
--- a/src/main/webapp/js/controllers.js
+++ b/src/main/webapp/js/controllers.js
@@ -95,12 +95,12 @@ module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams,
$scope.SubscriptionService = SubscriptionService;
- var unreadCount = function(category) {
+ $scope.unreadCount = function(category) {
var count = 0;
var i;
if (category.children) {
for (i = 0; i < category.children.length; i++) {
- count = count + unreadCount(category.children[i]);
+ count = count + $scope.unreadCount(category.children[i]);
}
}
if (category.feeds) {
@@ -113,7 +113,7 @@ module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams,
};
var rootUnreadCount = function() {
- return unreadCount($scope.SubscriptionService.subscriptions);
+ return $scope.unreadCount($scope.SubscriptionService.subscriptions);
};
$scope.$watch(rootUnreadCount, function(value) {
@@ -125,7 +125,7 @@ module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams,
});
$scope.formatCategoryName = function(category) {
- var count = unreadCount(category);
+ var count = $scope.unreadCount(category);
var label = category.name;
if (count > 0) {
label = label + ' (' + count + ')';
diff --git a/src/main/webapp/js/directives.js b/src/main/webapp/js/directives.js
index cf35441f..a2c7758e 100644
--- a/src/main/webapp/js/directives.js
+++ b/src/main/webapp/js/directives.js
@@ -49,6 +49,7 @@ module.directive('category', function($compile) {
selectedId : '=',
feedClick : '&',
categoryClick : '&',
+ unreadCount : '&',
formatCategoryName : '&',
formatFeedName : '&'
},
@@ -59,7 +60,8 @@ module.directive('category', function($compile) {
var ul = element.find('ul');
var html = ' ';
+ html = html + 'format-category-name="formatCategoryName({category:category})" format-feed-name="formatFeedName({feed:feed})" ';
+ html = html + 'unread-count="unreadCount({category:category})">';
html = html + '';
ul.prepend(html);
$compile(ul.contents())(scope);
diff --git a/src/main/webapp/templates/_tree.html b/src/main/webapp/templates/_tree.html
index 36638188..ab8bfa10 100644
--- a/src/main/webapp/templates/_tree.html
+++ b/src/main/webapp/templates/_tree.html
@@ -4,6 +4,7 @@
feed-click="feedClicked(id)" category-click="categoryClicked(id)"
selected-type="selectedType" selected-id="selectedId"
format-category-name="formatCategoryName(category)"
- format-feed-name="formatFeedName(feed)">
+ format-feed-name="formatFeedName(feed)"
+ unread-count="unreadCount(category)">
\ No newline at end of file