Vulcan/packages/telescope-posts/lib/client/templates/modules/post_admin.js

23 lines
595 B
JavaScript
Raw Normal View History

Template.postAdmin.helpers({
showApprove: function () {
return this.status == Posts.config.STATUS_PENDING;
},
showUnapprove: function(){
return !!Settings.get('requirePostsApproval') && this.status == Posts.config.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.postAdmin.events({
2014-12-05 09:33:07 +09:00
'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
});