<commit_before>Websites = new Mongo.Collection("websites");

if (Meteor.isClient) {

	// Router configuration
	Router.configure({
	  layoutTemplate: 'appLayout'
	});

	Router.route('/', function () {
	  this.render('nav', {
	    to:"navbar"
	  });
	  this.render('websites', {
	    to:"main"
	  });
	});

	Router.route('/details/:_id', function () {
	  this.render('nav', {
	    to:"navbar"
	  });
	  this.render('details', {
	    to:"main",
	    data:function(){
	      return Websites.findOne({_id:this.params._id});
	    }
	  });
	});

	// configuring the login to accept usernames
	Accounts.ui.config({passwordSignupFields: 'USERNAME_AND_EMAIL'})

	/////
	// template helpers
	/////

	// helper function that returns all available websites
	Template.website_list.helpers({
		websites:function(){
			return Websites.find({}, {sort: {upvote: -1}});
		}
	});

	/////
	// template events
	/////

	Template.website_item.events({
		"click .js-upvote":function(event){
			// example of how you can access the id for the website in the database
			// (this is the data context for the template)
			var website_id = this._id;

			// put the code in here to add a vote to a website!
			if (Meteor.userId()){
				console.log("Up voting website with id " + website_id);
				Websites.update(
					{_id: website_id},
					{$inc: {upvote: 1}}
				);
			} else {
				console.log("please log in to vote");
			}

			return false;// prevent the button from reloading the page
		},<commit_msg>pushing last minute change<commit_after>Websites = new Mongo.Collection("websites");

if (Meteor.isClient) {

	// Router configuration
	Router.configure({
	  layoutTemplate: 'appLayout'
	});

	Router.route('/', function () {
	  this.render('nav', {
	    to:"navbar"
	  });
	  this.render('websites', {
	    to:"main"
	  });
	});

	Router.route('/details/:_id', function () {
	  this.render('nav', {
	    to:"navbar"
	  });
	  this.render('details', {
	    to:"main",
	    data:function(){
	      return Websites.findOne({_id:this.params._id});
	    }
	  });
	});

	// configuring the login to accept usernames
	Accounts.ui.config({passwordSignupFields: 'USERNAME_AND_EMAIL'})

	/////
	// template helpers
	/////

	// helper function that returns all available websites
	Template.website_list.helpers({
		websites:function(){
			return Websites.find({}, {sort: {upvote: -1}});
		}
	});

	/////
	// template events
	/////

	Template.website_item.events({
		"click .js-upvote":function(event){
			// example of how you can access the id for the website in the database
			// (this is the data context for the template)
			var website_id = this._id;

			// put the code in here to add a vote to a website!
			if (Meteor.userId()){
				console.log("Up voting website with id " + website_id);
				Websites.update(
					{_id: website_id},
					{$inc: {upvote: 1}}
				);
			} else {
				console.log("please log in to vote");
			}

			return false;// prevent the button from reloading the page
		},
		
{'fraction_non_alphanumeric': 0.16363636363636364, 'fraction_numerical': 0.0013468013468013469, 'mean_word_length': 2.853437094682231, 'pattern_counts': {'":': 2, '<': 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': '1483685', 'n_tokens_mistral': 1126, 'n_tokens_neox': 969, 'n_words': 243}