123456789101112131415161718192021222324
  1. import { Template } from 'meteor/templating';
  2. import { Meteor } from 'meteor/meteor';
  3. //import { Tasks } from '../api/tasks.js';
  4. import './task.html';
  5. Template.task.helpers({
  6. isOwner() {
  7. return this.owner === Meteor.userId();
  8. },
  9. });
  10. Template.task.events({
  11. 'click .toggle-checked'() {
  12. // Set the checked property to the opposite of its current value
  13. Meteor.call('tasks.setChecked', this._id, !this.checked);
  14. },
  15. 'click .delete'() {
  16. Meteor.call('tasks.remove', this._id);
  17. },
  18. 'click .toggle-private'() {
  19. Meteor.call('tasks.setPrivate', this._id, !this.private);
  20. },
  21. });