diff --git a/client/views/admin/settings.html b/client/views/admin/settings.html
index ed9a3bb65..83d4e5431 100644
--- a/client/views/admin/settings.html
+++ b/client/views/admin/settings.html
@@ -7,6 +7,12 @@
No settings yet.
{{/if}}
{{#if currentUser.isAdmin}}
+
diff --git a/client/views/admin/settings.js b/client/views/admin/settings.js
index 9a291968b..1a1be63c0 100644
--- a/client/views/admin/settings.js
+++ b/client/views/admin/settings.js
@@ -2,6 +2,7 @@ Template.settings.events = {
'click input[type=submit]': function(e){
e.preventDefault();
if(!Meteor.user()) throw 'You must be logged in.';
+ var requireInvite=!!$('#requireInvite').attr('checked');
var title= $('#title').val();
var theme = $('#theme').val();
var footerCode=$("#footerCode").val();
@@ -23,6 +24,7 @@ Template.settings.events = {
if(prevSetting){
Settings.update(prevSetting._id,{
$set: {
+ requireInvite:requireInvite,
title: title,
theme: theme,
footerCode: footerCode,
@@ -46,6 +48,7 @@ Template.settings.events = {
});
}else{
var settingId = Settings.insert({
+ requireInvite:requireInvite,
title: title,
theme: theme,
footerCode: footerCode,
diff --git a/client/views/comments/comment_page.html b/client/views/comments/comment_page.html
index 18f5eaf00..26da6865b 100644
--- a/client/views/comments/comment_page.html
+++ b/client/views/comments/comment_page.html
@@ -14,7 +14,7 @@
{{/with}}
{{/if}}
- {{#if currentUser.approved}}
+ {{#if canPostComment}}
{{> comment_form}}
{{/if}}
diff --git a/client/views/comments/comment_page.js b/client/views/comments/comment_page.js
index aa5b575b9..967cb9f21 100644
--- a/client/views/comments/comment_page.js
+++ b/client/views/comments/comment_page.js
@@ -3,8 +3,13 @@ Template.comment_page.post = function(){
return selectedComment && Posts.findOne(selectedComment.post);
};
-Template.comment_page.comment = function(){
- var comment = Comments.findOne(Session.get('selectedCommentId'));
- Template.comment_page.repress_recursion = true;
- return comment;
-};
\ No newline at end of file
+Template.comment_page.helpers({
+ comment: function(){
+ var comment = Comments.findOne(Session.get('selectedCommentId'));
+ Template.comment_page.repress_recursion = true;
+ return comment;
+ },
+ canComment: function(){
+ return canComment(Meteor.user());
+ }
+});
\ No newline at end of file
diff --git a/client/views/nav.html b/client/views/nav.html
index 39dd8604b..94f1185cf 100644
--- a/client/views/nav.html
+++ b/client/views/nav.html
@@ -50,7 +50,7 @@