Vulcan/client/views/posts/modules/post_admin.js

23 lines
601 B
JavaScript
Raw Normal View History

Template[getTemplate('postAdmin')].helpers({
showApprove: function () {
return this.status == STATUS_PENDING;
},
showUnapprove: function(){
2015-03-28 18:30:26 +09:00
return !!Settings.get('requirePostsApproval') && this.status == STATUS_APPROVED;
},
shortScore: function(){
return Math.floor(this.score*1000)/1000;
2014-09-16 15:46:48 -04:00
}
2014-12-05 09:33:07 +09:00
});
Template[getTemplate('postAdmin')].events({
'click .approve-link': function(e, instance){
Meteor.call('approvePost', this);
e.preventDefault();
2015-03-28 18:30:26 +09:00
},
2014-12-05 09:33:07 +09:00
'click .unapprove-link': function(e, instance){
Meteor.call('unapprovePost', this);
e.preventDefault();
}
2015-03-28 18:30:26 +09:00
});