<commit_before>Template.singleBet.helpers({
  openStatus: function(){
    return ( this.status === "open" ) ? true : false;
  },

  pendingStatus: function(){
    return ( this.status === "pending" ) ? true : false;
  },

  completedStatus: function(){
    return ( this.status === "completed" ) ? true : false;
  },

  showEditForm: function(){
    if( Session.get("edit") ){
      return true;
    } else {
      Session.set("edit", false);
      return false;
    }
  },

  showCompleteBetForm: function(){
    if( Session.get("complete?") ){
      return true;
    } else {
      Session.set("complete?", false);
      return false;
    }
  }
});

Template.singleBet.events({
  'click .remove_bet_button' : function(){
    Meteor.call("deleteBet", this._id);
    Router.go('/bets')
  },

  'click .accept_button' : function(){
     Meteor.call("updateStatus", this._id, "pending");
     Meteor.call("createBetNotification", this.bettors[0], this.bettors[1], "accepted", this._id);
  },

  'click .complete_bet_button' : function(){
    Session.set("complete?", !Session.get("complete?"))
  },

  'click .edit_button' : function(){
    Session.set('edit', !Session.get('edit'));
  },

  'submit .select-winner' : function(event){
    event.preventDefault();
    var winner =  event.target.children.choose_winner.value;

    Meteor.call("completeBet", this._id, winner );
    Session.set("complete?", false);
    Meteor.call("createBetNotification", this.bettors[0], this.bettors[1], "completed", this._id);
  },

  'submit .edit-bet' : function(event){
    event.preventDefault();

    var bet = {}
    bet._id = this._id;
    bet.title = event.target.betTitle.value;
    bet.wager = event.target.betWager.value;
    bet.user = Meteor.user();<commit_msg>Spacing<commit_after>Template.singleBet.helpers({
  openStatus: function(){
    return ( this.status === "open" ) ? true : false;
  },

  pendingStatus: function(){
    return ( this.status === "pending" ) ? true : false;
  },

  completedStatus: function(){
    return ( this.status === "completed" ) ? true : false;
  },

  showEditForm: function(){
    if( Session.get("edit") ){
      return true;
    } else {
      Session.set("edit", false);
      return false;
    }
  },

  showCompleteBetForm: function(){
    if( Session.get("complete?") ){
      return true;
    } else {
      Session.set("complete?", false);
      return false;
    }
  }
});

Template.singleBet.events({
  'click .remove_bet_button' : function(){
    Meteor.call("deleteBet", this._id);
    Router.go('/bets')
  },

  'click .accept_button' : function(){
     Meteor.call("updateStatus", this._id, "pending");
     Meteor.call("createBetNotification", this.bettors[0], this.bettors[1], "accepted", this._id);
  },

  'click .complete_bet_button' : function(){
    Session.set( "complete?", !Session.get("complete?") )
  },

  'click .edit_button' : function(){
    Session.set( 'edit', !Session.get('edit') );
  },

  'submit .select-winner' : function(event){
    event.preventDefault();
    var winner =  event.target.children.choose_winner.value;

    Meteor.call("completeBet", this._id, winner );
    Session.set("complete?", false);
    Meteor.call("createBetNotification", this.bettors[0], this.bettors[1], "completed", this._id);
  },

  'submit .edit-bet' : function(event){
    event.preventDefault();

    var bet = {}
    bet._id = this._id;
    bet.title = event.target.betTitle.value;
    bet.wager = event.target.betWager.value;
    bet.user = Meteor.user();
{'fraction_non_alphanumeric': 0.18109339407744876, 'fraction_numerical': 0.002277904328018223, 'mean_word_length': 3.3104294478527607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2628175', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1137, 'n_words': 207}