feeds require to be enabled

This commit is contained in:
Sacha Greif 2014-12-31 11:54:38 +09:00
parent 0d983355eb
commit 37ab8d48b9
4 changed files with 36 additions and 12 deletions

View file

@ -34,12 +34,12 @@ Meteor.methods({
}
});
resetNewsletterSchedule = function () {
resetNewsletterJob = function () {
SyncedCron.stop();
addSchedule();
addJob();
}
var addSchedule = function () {
var addJob = function () {
SyncedCron.add({
name: 'scheduleNewsletter',
schedule: function(parser) {
@ -54,6 +54,6 @@ var addSchedule = function () {
}
Meteor.startup(function () {
if (getSetting('enableNewsletter', false)) {
addSchedule();
addJob();
}
});

View file

@ -36,6 +36,21 @@ var feedItemIdProperty = {
}
addToPostSchema.push(feedItemIdProperty);
// Settings
var enableFeeds = {
propertyName: 'enableFeeds',
propertySchema: {
type: Boolean,
optional: true,
autoform: {
group: 'feeds',
instructions: 'Enable posting from RSS feeds (requires restart).'
}
}
}
addToSettingsSchema.push(enableFeeds);
Meteor.startup(function () {
Feeds.allow({
insert: isAdminById,

View file

@ -1,9 +1,17 @@
SyncedCron.add({
name: 'Post by RSS feed',
schedule: function(parser) {
return parser.text('every 30 minutes');
},
job: function() {
fetchFeeds();
var addJob = function () {
SyncedCron.add({
name: 'Post by RSS feed',
schedule: function(parser) {
return parser.text('every 30 minutes');
},
job: function() {
fetchFeeds();
}
});
}
Meteor.startup(function () {
if (getSetting('enableFeeds', false)) {
addJob();
}
});
})

View file

@ -199,6 +199,7 @@ input[type="search"]{
padding-bottom: 5px;
margin-bottom: 15px;
border-bottom: 1px solid #B5B0B0;
color: $light-text;
}
fieldset{
margin-bottom: 30px;