display next refresh date

This commit is contained in:
Athou
2013-05-22 16:10:50 +02:00
parent 97c2c12fe2
commit 0fdb714641
4 changed files with 33 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedSubscription;
import com.wordnik.swagger.annotations.ApiClass;
@@ -21,14 +22,16 @@ public class Subscription implements Serializable {
public static Subscription build(FeedSubscription subscription,
long unreadCount) {
FeedCategory category = subscription.getCategory();
Feed feed = subscription.getFeed();
Subscription sub = new Subscription();
sub.setId(subscription.getId());
sub.setName(subscription.getTitle());
sub.setMessage(subscription.getFeed().getMessage());
sub.setErrorCount(subscription.getFeed().getErrorCount());
sub.setFeedUrl(subscription.getFeed().getUrl());
sub.setFeedLink(subscription.getFeed().getLink());
sub.setLastRefresh(subscription.getFeed().getLastUpdated());
sub.setMessage(feed.getMessage());
sub.setErrorCount(feed.getErrorCount());
sub.setFeedUrl(feed.getUrl());
sub.setFeedLink(feed.getLink());
sub.setLastRefresh(feed.getLastUpdated());
sub.setNextRefresh(feed.getDisabledUntil());
sub.setUnread(unreadCount);
sub.setCategoryId(category == null ? null : String.valueOf(category
.getId()));
@@ -50,6 +53,9 @@ public class Subscription implements Serializable {
@ApiProperty(value = "last time the feed was refreshed", required = true)
private Date lastRefresh;
@ApiProperty(value = "next time the feed refresh is planned", required = true)
private Date nextRefresh;
@ApiProperty(value = "this subscription's feed url", required = true)
private String feedUrl;
@@ -134,4 +140,12 @@ public class Subscription implements Serializable {
this.categoryId = categoryId;
}
public Date getNextRefresh() {
return nextRefresh;
}
public void setNextRefresh(Date nextRefresh) {
this.nextRefresh = nextRefresh;
}
}

View File

@@ -61,6 +61,8 @@ details.url=URL
details.name=Name
details.category=Category
details.last_refresh=Last refresh
details.next_refresh=Next refresh
details.queued_for_refresh=Queued for refresh
details.feed_url=Feed URL
details.generate_api_key_first=Generate an API key in your profile first.
details.unsubscribe=Unsubscribe

View File

@@ -1,7 +1,11 @@
var module = angular.module('commafeed.filters', []);
module.filter('entryDate', function() {
return function(timestamp) {
return function(timestamp, defaultValue) {
if (!timestamp) {
return defaultValue;
}
var d = moment(timestamp);
var now = moment();
var formatted;

View File

@@ -33,6 +33,13 @@
<span>{{sub.lastRefresh|entryDate}}</span>
</div>
</div>
<div class="control-group">
<label class="control-label">${details.next_refresh}</label>
<div class="controls horizontal-align">
<span>{{sub.nextRefresh|entryDate:'${details.queued_for_refresh}' }}</span>
</div>
</div>
<div class="control-group">
<label class="control-label">${details.feed_url}</label>