<commit_before>Meteor.subscribe 'authors';
Meteor.subscribe 'Posts';
Meteor.subscribe 'Comments';

Template['posts'].helpers
  'posts': -> Posts.find({}, sort: {createdAt: -1})

Template.post.helpers
  'comments': -> Comments.find({post_id: @post._id})

# Template['posts'].events

Template['new-post'].events
  'submit .new-post': (e) ->
    e.preventDefault()
    Posts.insert
      'title': e.target.title.value
      'content': e.target.content.value
      'author': Meteor.userId()
      'createdAt': new Date()

Template.new_comment.events
  'submit .new_comment': (e) ->
    e.preventDefault
    Comments.insert
      'title': e.target.title.value
      'content': e.target.content.value
      'author': e.target.author.value
      'post_id': e.target.post_id.value
      'createdAt': new Date()<commit_msg>Fix on preventDefault method call<commit_after>Meteor.subscribe 'authors';
Meteor.subscribe 'Posts';
Meteor.subscribe 'Comments';

Template['posts'].helpers
  'posts': -> Posts.find({}, sort: {createdAt: -1})

Template.post.helpers
  'comments': -> Comments.find({post_id: @post._id})

# Template['posts'].events

Template['new-post'].events
  'submit .new-post': (e) ->
    e.preventDefault()
    Posts.insert
      'title': e.target.title.value
      'content': e.target.content.value
      'author': Meteor.userId()
      'createdAt': new Date()

Template.new_comment.events
  'submit .new_comment': (e) ->
    e.preventDefault()
    Comments.insert
      'title': e.target.title.value
      'content': e.target.content.value
      'author': e.target.author.value
      'post_id': e.target.post_id.value
      'createdAt': new Date()
{'fraction_non_alphanumeric': 0.1709090909090909, 'fraction_numerical': 0.0012121212121212121, 'mean_word_length': 3.4986376021798367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3689540', 'n_tokens_mistral': 547, 'n_tokens_neox': 542, 'n_words': 101}