Template.registerHelper("activeRoute", function(route) {
	var currentRoute = Router.current().route.getName();
	return currentRoute === route ? " active" : "";
});

Template.registerHelper("calendarTime", function(date) {
	if(date) {
		return moment(date).calendar();
	}
	return "Unknown";
});

Template.registerHelper("equals", function(a, b) {
	return a === b;
});

Template.navigation.events({
	"click #logout": function(e) {
		Meteor.logout(function(error) {
			if(error) {
				alert(error);
			}
			else {
				Router.go("login");
			}
		});
	}
});

Template.login.events({
	"click #facebookLogin": function(e) {
		Meteor.loginWithFacebook(function(error) {
			if(error) {
				alert(error);
			}
			else {
				Router.go("target");
			}
		});
	},
	"click #googleLogin": function(e) {
		Meteor.loginWithGoogle(function(error) {
			if(error) {
				alert(error);
			}
			else {
				Router.go("target");
			}
		});
	}
});

Template.target.helpers({
	"target": function() {
		return Meteor.users.findOne(Meteor.user().target).profile.name;
	},
	"actions": function() {
		return Actions.find({}, {sort: {"timestamp": -1}}).fetch();
	},
	"message": function() {
		var a = "Unknown";
		var m = "claims to have killed";
		var t = "Unknown";
		var c = "";
		var assassin = Meteor.users.findOne(this.assassin);
		var target = Meteor.users.findOne(this.target);

		if(this.assassin === Meteor.userId()) {a = "You"; m = "claim to have killed";}
		else if(assassin) {a = assassin.profile.name;}

		if(this.target === Meteor.userId()) {t = "You"; c = '<br><span>Is this correct? <a href="#" style="color: green;">Yes</a> / <a href="#" style="color: red;">No</a></span>';}
		else if(target) {t = target.profile.name;}
		if(this.confirmed) {m = "killed"; c = "";}

		return "<b>" + a + "</b> " + m + " <b>" + t + "</b>" + c;
	}
});

Template.target.events({
	"click #logout": function() {
		Meteor.logout(function(error) {
			if(error) {
				alert(error);
			}
			else {
				Router.go("login");
			}
		});
	}
});

Template.leaderboard.helpers({
	"userList": function() {
		return Meteor.users.find({"inGame": true}, {sort: {"kills": -1}}).fetch();
	}
});
@@ -1563,32 +1563,52 @@
 ect? %3Ca href=%22#%22
+ class=%22confirmKill%22
  style=%22color: g
@@ -1635,16 +1635,33 @@
 href=%22#%22
+ class=%22denyKill%22
  style=%22
@@ -1875,38 +1875,43 @@
 ents(%7B%0A%09%22click #
-logout
+confirmKill
 %22: function() %7B%0A
@@ -1910,128 +1910,154 @@
 ion(
+e
 ) %7B%0A%09%09
-Meteor.logout(function(error) %7B%0A%09%09%09if(error) %7B%0A%09%09%09%09alert(error
+e.preventDefault();%0A%09%09Meteor.call(%22confirmKill%22, this._id
 );%0A
-%09%09
 %09%7D
+,
 %0A%09
-%09%09else %7B%0A%09%09%09%09Router.go(%22login%22);%0A%09%09%09%7D%0A%09%09%7D);
+%22click #denyKill%22: function(e) %7B%0A%09%09e.preventDefault();%0A%09%09// TODO: denyKill
 %0A%09%7D%0A

Call confirmKill on click