diff --git a/client/views/admin/settings.html b/client/views/admin/settings.html
index 410915d77..afb876be5 100644
--- a/client/views/admin/settings.html
+++ b/client/views/admin/settings.html
@@ -3,7 +3,7 @@
{{#if this.hasSettings}}
{{> quickForm collection="Settings" id="updateSettingsForm" type="update" doc=this.settings label-class="control-label" input-col-class="controls" template="test"}}
{{else}}
- {{> quickForm collection="Settings" id="updateSettingsForm" type="insert" template="bootstrap3-horizontal" label-class="control-label" input-col-class="controls"}}
+ {{> quickForm collection="Settings" id="updateSettingsForm" type="insert" template="test" label-class="control-label" input-col-class="controls"}}
{{/if}}
\ No newline at end of file
diff --git a/client/views/settings/quickFormTest.html b/client/views/settings/quickFormTest.html
index b691de870..8639640aa 100644
--- a/client/views/settings/quickFormTest.html
+++ b/client/views/settings/quickFormTest.html
@@ -4,7 +4,7 @@
{{#each afFieldsets}}
{{/each}}
@@ -14,9 +14,9 @@
@@ -36,6 +36,9 @@
{{/if}}
{{> afFieldInput afFieldInputAtts}}
+ {{#if afFieldInstructions}}
+ {{afFieldInstructions}}
+ {{/if}}
{{{afFieldMessage name=this.atts.name}}}
diff --git a/client/views/settings/quickFormTest.js b/client/views/settings/quickFormTest.js
index 8d3e8033e..7369518ec 100644
--- a/client/views/settings/quickFormTest.js
+++ b/client/views/settings/quickFormTest.js
@@ -17,7 +17,7 @@ Template[getTemplate('quickForm_test')].helpers({
},
fieldsForFieldset: function () {
var fieldset = this.toLowerCase();
- var schema = Template.parentData(1)._af.ss._schema;
+ var schema = AutoForm.find().ss._schema;
// decorate schema with key names
schema = _.map(schema, function (field, key) {
@@ -101,6 +101,10 @@ Template["afFormGroup_test"].rightColumnClass = function () {
return atts['input-col-class'] || "";
};
+Template["afFormGroup_test"].afFieldInstructions = function () {
+ return this.afFieldInputAtts.instructions;
+};
+
Template["afObjectField_test"].rightColumnClass = function () {
var atts = this.atts || {};
return atts['input-col-class'] || "";
diff --git a/collections/comments.js b/collections/comments.js
index cb56662d4..f203ea66c 100644
--- a/collections/comments.js
+++ b/collections/comments.js
@@ -1,73 +1,73 @@
CommentSchema = new SimpleSchema({
- _id: {
- type: String,
- optional: true
- },
- parentCommentId: {
- type: String,
- optional: true
- },
- createdAt: {
- type: Date,
- optional: true
- },
- postedAt: { // for now, comments are always created and posted at the same time
- type: Date,
- optional: true
- },
- body: {
- type: String
- },
- htmlBody: {
- type: String,
- optional: true
- },
- baseScore: {
- type: Number,
- decimal: true,
- optional: true
- },
- score: {
- type: Number,
- decimal: true,
- optional: true
- },
- upvotes: {
- type: Number,
- optional: true
- },
- upvoters: {
- type: [String], // XXX
- optional: true
- },
- downvotes: {
- type: Number,
- optional: true
- },
- downvoters: {
- type: [String], // XXX
- optional: true
- },
- author: {
- type: String,
- optional: true
- },
- inactive: {
- type: Boolean,
- optional: true
- },
- postId: {
- type: String, // XXX
- optional: true
- },
- userId: {
- type: String, // XXX
- optional: true
- },
- isDeleted: {
- type: Boolean,
- optional: true
- }
+ _id: {
+ type: String,
+ optional: true
+ },
+ parentCommentId: {
+ type: String,
+ optional: true
+ },
+ createdAt: {
+ type: Date,
+ optional: true
+ },
+ postedAt: { // for now, comments are always created and posted at the same time
+ type: Date,
+ optional: true
+ },
+ body: {
+ type: String
+ },
+ htmlBody: {
+ type: String,
+ optional: true
+ },
+ baseScore: {
+ type: Number,
+ decimal: true,
+ optional: true
+ },
+ score: {
+ type: Number,
+ decimal: true,
+ optional: true
+ },
+ upvotes: {
+ type: Number,
+ optional: true
+ },
+ upvoters: {
+ type: [String], // XXX
+ optional: true
+ },
+ downvotes: {
+ type: Number,
+ optional: true
+ },
+ downvoters: {
+ type: [String], // XXX
+ optional: true
+ },
+ author: {
+ type: String,
+ optional: true
+ },
+ inactive: {
+ type: Boolean,
+ optional: true
+ },
+ postId: {
+ type: String, // XXX
+ optional: true
+ },
+ userId: {
+ type: String, // XXX
+ optional: true
+ },
+ isDeleted: {
+ type: Boolean,
+ optional: true
+ }
});
Comments = new Meteor.Collection("comments");
diff --git a/collections/settings.js b/collections/settings.js
index 8af0a9801..56211f952 100644
--- a/collections/settings.js
+++ b/collections/settings.js
@@ -10,9 +10,10 @@ settingsSchemaObject = {
siteUrl: {
type: String,
optional: true,
- label: 'Site URL (with trailing "/")',
+ label: 'Site URL',
autoform: {
- group: 'general'
+ group: 'general',
+ instructions: 'Your site\'s URL (with trailing "/"). Will default to Meteor.absoluteUrl()'
}
},
tagline: {
@@ -28,7 +29,7 @@ settingsSchemaObject = {
label: "Require invite to view",
optional: true,
autoform: {
- group: 'access'
+ group: 'invites'
}
},
requirePostInvite: {
@@ -36,7 +37,7 @@ settingsSchemaObject = {
label: "Require invite to post",
optional: true,
autoform: {
- group: 'access'
+ group: 'invites'
}
},
requirePostsApproval: {
@@ -47,42 +48,37 @@ settingsSchemaObject = {
group: 'access'
}
},
- emailNotifications: {
- type: Boolean,
- label: "Enable email notifications",
- optional: true,
- autoform: {
- group: 'email'
- }
- },
- nestedComments: {
- type: Boolean,
- label: "Enable nested comments",
- optional: true,
- autoform: {
- group: 'comments'
- }
- },
- redistributeKarma: {
- type: Boolean,
- label: "Enable redistributed karma",
- optional: true,
- autoform: {
- group: 'general'
- }
- },
+ // nestedComments: {
+ // type: Boolean,
+ // label: "Enable nested comments",
+ // optional: true,
+ // autoform: {
+ // group: 'comments'
+ // }
+ // },
+ // redistributeKarma: {
+ // type: Boolean,
+ // label: "Enable redistributed karma",
+ // optional: true,
+ // autoform: {
+ // group: 'general'
+ // }
+ // },
defaultEmail: {
type: String,
optional: true,
autoform: {
- group: 'email'
+ group: 'email',
+ instructions: 'The address all outgoing emails will be sent from.'
}
},
scoreUpdateInterval: {
type: Number,
optional: true,
+ defaultValue: 30,
autoform: {
- group: 'scoring'
+ group: 'scoring',
+ instructions: 'How often to recalculate scores, in seconds (default to 30)'
}
},
defaultView: {
@@ -101,22 +97,28 @@ settingsSchemaObject = {
postInterval: {
type: Number,
optional: true,
+ defaultValue: 30,
autoform: {
- group: 'posts'
+ group: 'posts',
+ instructions: 'Minimum time between posts, in seconds (defaults to 30)'
}
},
commentInterval: {
type: Number,
optional: true,
+ defaultValue: 15,
autoform: {
- group: 'comments'
+ group: 'comments',
+ instructions: 'Minimum time between comments, in seconds (defaults to 15)'
}
},
maxPostsPerDay: {
type: Number,
optional: true,
+ defaultValue: 30,
autoform: {
- group: 'posts'
+ group: 'posts',
+ instructions: 'Maximum number of posts a user can post in a day (default to 30).'
}
},
startInvitesCount: {
@@ -124,7 +126,7 @@ settingsSchemaObject = {
defaultValue: 3,
optional: true,
autoform: {
- group: 'general'
+ group: 'invites'
}
},
postsPerPage: {
@@ -161,15 +163,16 @@ settingsSchemaObject = {
defaultValue: 'en',
optional: true,
autoform: {
- group: 'general'
+ group: 'internationalization'
}
},
backgroundCSS: {
type: String,
optional: true,
- label: "Background CSS: color, image, etc.",
+ label: "Background CSS",
autoform: {
- group: 'extras'
+ group: 'extras',
+ instructions: 'CSS code for the <body>\'s "background" property'
}
},
// secondaryColor: {
@@ -236,28 +239,32 @@ settingsSchemaObject = {
type: String,
optional: true,
autoform: {
- group: 'extras'
+ group: 'extras',
+ instructions: 'Footer content (accepts HTML).'
}
},
extraCode: {
type: String,
optional: true,
autoform: {
- group: 'extras'
+ group: 'extras',
+ instructions: 'Any extra HTML code you want to include on every page.'
}
},
emailFooter: {
type: String,
optional: true,
autoform: {
- group: 'email'
+ group: 'email',
+ instructions: 'Content that will appear at the bottom of outgoing emails (accepts HTML).'
}
},
notes: {
type: String,
optional: true,
autoform: {
- group: 'extras'
+ group: 'extras',
+ instructions: 'You can store any notes or extra information here.'
}
},
};
diff --git a/packages/telescope-newsletter/lib/newsletter.js b/packages/telescope-newsletter/lib/newsletter.js
index d14ff05a3..338a6e1b5 100644
--- a/packages/telescope-newsletter/lib/newsletter.js
+++ b/packages/telescope-newsletter/lib/newsletter.js
@@ -50,7 +50,8 @@ var showBanner = {
optional: true,
label: 'Show newsletter sign-up banner',
autoform: {
- group: 'newsletter'
+ group: 'newsletter',
+ instructions: 'Show newsletter sign-up form on the front page.'
}
}
}
@@ -74,7 +75,8 @@ var mailChimpListId = {
type: String,
optional: true,
autoform: {
- group: 'newsletter'
+ group: 'newsletter',
+ instructions: 'The ID of the list you want to send to.'
}
}
}
diff --git a/packages/telescope-notifications/lib/notifications.js b/packages/telescope-notifications/lib/notifications.js
index fbac625d5..7461ff06c 100644
--- a/packages/telescope-notifications/lib/notifications.js
+++ b/packages/telescope-notifications/lib/notifications.js
@@ -101,7 +101,7 @@ Meteor.methods({
// add new post notification callback on post submit
postAfterSubmitMethodCallbacks.push(function (post) {
- if(Meteor.isServer && !!getSetting('emailNotifications', false)){
+ if(Meteor.isServer && !!getSetting('emailNotifications', true)){
// we don't want emails to hold up the post submission, so we make the whole thing async with setTimeout
Meteor.setTimeout(function () {
newPostNotification(post, [post.userId])
@@ -112,7 +112,7 @@ postAfterSubmitMethodCallbacks.push(function (post) {
// add new comment notification callback on comment submit
commentAfterSubmitMethodCallbacks.push(function (comment) {
- if(Meteor.isServer){
+ if(Meteor.isServer && !!getSetting('emailNotifications', true)){
var parentCommentId = comment.parentCommentId;
var user = Meteor.user();
@@ -150,4 +150,18 @@ commentAfterSubmitMethodCallbacks.push(function (comment) {
}
return comment;
-});
\ No newline at end of file
+});
+
+var emailNotifications = {
+ propertyName: 'emailNotifications',
+ propertySchema: {
+ type: Boolean,
+ optional: true,
+ defaultValue: true,
+ autoform: {
+ group: 'notifications',
+ instructions: 'Enable email notifications for new posts and new comments.'
+ }
+ }
+}
+addToSettingsSchema.push(emailNotifications);
diff --git a/packages/telescope-theme-base/lib/client/css/screen.css b/packages/telescope-theme-base/lib/client/css/screen.css
index 458c1a1ac..1432a955d 100644
--- a/packages/telescope-theme-base/lib/client/css/screen.css
+++ b/packages/telescope-theme-base/lib/client/css/screen.css
@@ -322,6 +322,13 @@ input[type="search"] {
fieldset {
margin-bottom: 30px; }
+/* line 181, ../scss/global/_forms.scss */
+.instructions-block {
+ margin-top: 5px;
+ display: block;
+ font-size: 80%;
+ color: rgba(0, 0, 0, 0.6); }
+
/* line 1, ../scss/global/_links.scss */
a {
text-decoration: none; }
diff --git a/packages/telescope-theme-base/lib/client/scss/global/_forms.scss b/packages/telescope-theme-base/lib/client/scss/global/_forms.scss
index 18311f57c..8133a488d 100644
--- a/packages/telescope-theme-base/lib/client/scss/global/_forms.scss
+++ b/packages/telescope-theme-base/lib/client/scss/global/_forms.scss
@@ -177,4 +177,10 @@ input[type="search"]{
}
fieldset{
margin-bottom: 30px;
+}
+.instructions-block{
+ margin-top: 5px;
+ display: block;
+ font-size: 80%;
+ color: black(0.6);
}
\ No newline at end of file