mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
19 lines
539 B
JavaScript
19 lines
539 B
JavaScript
Template.post_page.helpers({
|
|
canView: function () {
|
|
var post = this;
|
|
var user = Meteor.user();
|
|
if (post.status === Posts.config.STATUS_PENDING && !Users.can.viewPendingPost(user, post)) {
|
|
return false;
|
|
} else if (post.status === Posts.config.STATUS_REJECTED && !Users.can.viewRejectedPost(user, post)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
isPending: function () {
|
|
return this.status === Posts.config.STATUS_PENDING;
|
|
}
|
|
});
|
|
|
|
Template.post_page.rendered = function(){
|
|
$('body').scrollTop(0);
|
|
};
|