implemented RSS feeds for topics (and days) by simply wrapping the site.rss_action
This commit is contained in:
parent
518a568053
commit
c1952c0138
2 changed files with 21 additions and 5 deletions
|
@ -14,4 +14,14 @@ function main_action() {
|
||||||
res.data.title += this.groupname;
|
res.data.title += this.groupname;
|
||||||
res.data.body = this.renderSkinAsString("main");
|
res.data.body = this.renderSkinAsString("main");
|
||||||
path.site.renderSkin("page");
|
path.site.renderSkin("page");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* rss feed for specific days and topics
|
||||||
|
*/
|
||||||
|
function rss_action() {
|
||||||
|
req.data.show = this._prototype;
|
||||||
|
req.data[this._prototype] = this.groupname;
|
||||||
|
path.site.rss_action();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
|
@ -147,10 +147,16 @@ function rss_action() {
|
||||||
var sdf = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
var sdf = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||||
sdf.setTimeZone(new java.util.SimpleTimeZone(0, "UTC"));
|
sdf.setTimeZone(new java.util.SimpleTimeZone(0, "UTC"));
|
||||||
|
|
||||||
var collection = this.allstories;
|
if (req.data.show == "all") {
|
||||||
if (req.data.show == "all")
|
var collection = this.allcontent;
|
||||||
collection = this.allcontent;
|
} else if (req.data.show == "day") {
|
||||||
var size = collection.size();
|
var collection = this.get(req.data.day);
|
||||||
|
} else if (req.data.show == "topic") {
|
||||||
|
var collection = this.topics.get(req.data.topic);
|
||||||
|
} else {
|
||||||
|
var collection = this.allstories;
|
||||||
|
}
|
||||||
|
var size = (collection != null) ? collection.size() : 0;
|
||||||
var max = req.data.max ? parseInt(req.data.max) : 7;
|
var max = req.data.max ? parseInt(req.data.max) : 7;
|
||||||
max = Math.min(max, size);
|
max = Math.min(max, size);
|
||||||
max = Math.min(max, 10);
|
max = Math.min(max, 10);
|
||||||
|
|
Loading…
Add table
Reference in a new issue