post_item.js 370 B

123456789101112131415161718192021
  1. /**
  2. * @file
  3. *
  4. *
  5. * User: marand
  6. * Date: 30/08/15
  7. * Time: 10:15
  8. */
  9. Template.postItem.helpers({
  10. ownPost: function () {
  11. // Template is invoked in the context of a Post, so 'this' is a Post.
  12. return this.userId === Meteor.userId();
  13. },
  14. domain: function () {
  15. var a = document.createElement('a');
  16. a.href = this.url;
  17. return a.hostname;
  18. }
  19. });