 
 Template.vessels.events
 
+	'keyup #vesselSearch': (e) ->
+		searchString.set(e.target.value)
+
 	'click #addVessel': ->
 		wrs -> FlowRouter.setQueryParams addVessel: true
-
-	'keyup #vesselSearch': (e) ->
-		searchString.set(e.target.value)

			vessels = Vessels.find {}, sort: name: 1

			columns = [
				{ name: 'id', title: '', breakpoints: '', filterable: false }
				{ name: 'name', title: TAPi18n.__('vessels.name'), breakpoints: '' }
				{ name: 'flag', title: TAPi18n.__('vessels.flag'), breakpoints: 'xs' }
				{ name: 'type', title: TAPi18n.__('vessels.type'), breakpoints: 'xs' }
				{ name: 'callsign', title: TAPi18n.__('vessels.callsign'), breakpoints: '' }
				{ name: 'eni', title: TAPi18n.__('vessels.eni'), breakpoints: 'xs' }
				{ name: 'imo', title: TAPi18n.__('vessels.imo'), breakpoints: 'xs' }
				{ name: 'mmsi', title: TAPi18n.__('vessels.mmsi'), breakpoints: 'xs' }
				{ name: 'lastVisit', title: TAPi18n.__('vessels.lastVisit'), breakpoints: 'xs' }
				{ name: 'harborGroup', title: TAPi18n.__('vessels.harborGroup'), breakpoints: 'xs' }
				{ name: 'nextVisit', title: TAPi18n.__('vessels.nextVisit'), breakpoints: 'xs' }
				{ name: 'languages', title: TAPi18n.__('vessels.languages'), breakpoints: 'xs' }
			]

			rows = []

			for vessel, index in vessels.fetch()
				rows.push
					id: index + 1
					name: vessel.name
					flag: vessel.flag

					alwaysShow: true
					allowAdd: false
					allowDelete: false
					editRow: (row) -> wrs ->

	@autorun ->
		FlowRouter.getParam('language') # redraw with new language
