mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
display next refresh date
This commit is contained in:
@@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import com.commafeed.backend.model.Feed;
|
||||||
import com.commafeed.backend.model.FeedCategory;
|
import com.commafeed.backend.model.FeedCategory;
|
||||||
import com.commafeed.backend.model.FeedSubscription;
|
import com.commafeed.backend.model.FeedSubscription;
|
||||||
import com.wordnik.swagger.annotations.ApiClass;
|
import com.wordnik.swagger.annotations.ApiClass;
|
||||||
@@ -21,14 +22,16 @@ public class Subscription implements Serializable {
|
|||||||
public static Subscription build(FeedSubscription subscription,
|
public static Subscription build(FeedSubscription subscription,
|
||||||
long unreadCount) {
|
long unreadCount) {
|
||||||
FeedCategory category = subscription.getCategory();
|
FeedCategory category = subscription.getCategory();
|
||||||
|
Feed feed = subscription.getFeed();
|
||||||
Subscription sub = new Subscription();
|
Subscription sub = new Subscription();
|
||||||
sub.setId(subscription.getId());
|
sub.setId(subscription.getId());
|
||||||
sub.setName(subscription.getTitle());
|
sub.setName(subscription.getTitle());
|
||||||
sub.setMessage(subscription.getFeed().getMessage());
|
sub.setMessage(feed.getMessage());
|
||||||
sub.setErrorCount(subscription.getFeed().getErrorCount());
|
sub.setErrorCount(feed.getErrorCount());
|
||||||
sub.setFeedUrl(subscription.getFeed().getUrl());
|
sub.setFeedUrl(feed.getUrl());
|
||||||
sub.setFeedLink(subscription.getFeed().getLink());
|
sub.setFeedLink(feed.getLink());
|
||||||
sub.setLastRefresh(subscription.getFeed().getLastUpdated());
|
sub.setLastRefresh(feed.getLastUpdated());
|
||||||
|
sub.setNextRefresh(feed.getDisabledUntil());
|
||||||
sub.setUnread(unreadCount);
|
sub.setUnread(unreadCount);
|
||||||
sub.setCategoryId(category == null ? null : String.valueOf(category
|
sub.setCategoryId(category == null ? null : String.valueOf(category
|
||||||
.getId()));
|
.getId()));
|
||||||
@@ -50,6 +53,9 @@ public class Subscription implements Serializable {
|
|||||||
@ApiProperty(value = "last time the feed was refreshed", required = true)
|
@ApiProperty(value = "last time the feed was refreshed", required = true)
|
||||||
private Date lastRefresh;
|
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)
|
@ApiProperty(value = "this subscription's feed url", required = true)
|
||||||
private String feedUrl;
|
private String feedUrl;
|
||||||
|
|
||||||
@@ -134,4 +140,12 @@ public class Subscription implements Serializable {
|
|||||||
this.categoryId = categoryId;
|
this.categoryId = categoryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getNextRefresh() {
|
||||||
|
return nextRefresh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNextRefresh(Date nextRefresh) {
|
||||||
|
this.nextRefresh = nextRefresh;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -61,6 +61,8 @@ details.url=URL
|
|||||||
details.name=Name
|
details.name=Name
|
||||||
details.category=Category
|
details.category=Category
|
||||||
details.last_refresh=Last refresh
|
details.last_refresh=Last refresh
|
||||||
|
details.next_refresh=Next refresh
|
||||||
|
details.queued_for_refresh=Queued for refresh
|
||||||
details.feed_url=Feed URL
|
details.feed_url=Feed URL
|
||||||
details.generate_api_key_first=Generate an API key in your profile first.
|
details.generate_api_key_first=Generate an API key in your profile first.
|
||||||
details.unsubscribe=Unsubscribe
|
details.unsubscribe=Unsubscribe
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
var module = angular.module('commafeed.filters', []);
|
var module = angular.module('commafeed.filters', []);
|
||||||
|
|
||||||
module.filter('entryDate', function() {
|
module.filter('entryDate', function() {
|
||||||
return function(timestamp) {
|
return function(timestamp, defaultValue) {
|
||||||
|
if (!timestamp) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
var d = moment(timestamp);
|
var d = moment(timestamp);
|
||||||
var now = moment();
|
var now = moment();
|
||||||
var formatted;
|
var formatted;
|
||||||
|
|||||||
@@ -33,6 +33,13 @@
|
|||||||
<span>{{sub.lastRefresh|entryDate}}</span>
|
<span>{{sub.lastRefresh|entryDate}}</span>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="control-group">
|
||||||
<label class="control-label">${details.feed_url}</label>
|
<label class="control-label">${details.feed_url}</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user