Router.map(function () {
	this.route('find', {
		path: '/find/:search?',
		template: 'find',
		waitOn: function () {
			var region = Session.get('region')
			var filter = {}
			if (this.params.hasUpcomingEvent) filter.hasUpcomingEvent = true;
			return Meteor.subscribe('coursesFind', region, this.params.search, filter);
		},
		data: function() {
			return {
				hasUpcomingEvent: this.params.hasUpcomingEvent,
				query: this.params.search,
				results: Courses.find()
			}
		},
		onAfterAction: function() {
			document.title = webpagename + 'Find ' + this.params.search
		}
	})
})

var submitForm = function(event) {
	options = {}
	if ($("#hasUpcomingEvent")[0].checked) {
		options.query = "hasUpcomingEvent";
	}

	Router.go('find', { search: $('#find').val().replace("/", " ")}, options )
	event.preventDefault();
	event.stopPropagation();
	return false; 
}

Template.find.events({
	'submit': submitForm,
	'change': submitForm
});

Template.find.helpers({
	'hasUpcomingEventsChecked': function() {
		if (this.hasUpcomingEvent) return "checked";
	}
})
@@ -341,16 +341,142 @@
 ion() %7B%0A
+%09%09%09var region = Session.get('region')%0A%09%09%09var filter = %7B%7D%0A%09%09%09if (this.params.hasUpcomingEvent) filter.hasUpcomingEvent = true;%0A
 %09%09%09retur
@@ -479,16 +479,16 @@
 eturn %7B%0A
-
 %09%09%09%09hasU
@@ -579,21 +579,54 @@
 ts: 
-C
+c
 ourses
-.f
+F
 ind(
+region, this.params.search, filter
 )%0A%09%09

fix displaying only matching courses