 
 Handlebars.registerHelper 'ListForm', (data, context) ->
 	fields = []
-	providedFields = data.form.helpers.fields
+	if data.helpers?
+		providedFields = data.helpers.fields
+	else
+		providedFields = data.form.helpers.fields
 	if not Array.isArray(providedFields)
 		for key in Object.keys(providedFields)
 			options = providedFields[key]

	selected: () ->
		context = this.context
		single = context.single
		user = Meteor.user()
		
		return getUserSelectedItem(user, single, this._id) and 'alert-info'

Template._listRow.events
	"click .close-form": () ->

# names in listFields.
Handlebars.registerHelper 'listColumnHeaders', (data) ->
	listFields = data.listFields
	if Array.isArray(listFields) and listFields.length > 0
		columnHeaders = 
			for field in listFields
				if field.label?
					field.label.titleize()
				else
					field.name.titleize()

		returnData = 
			columnHeaders: columnHeaders

		return new Handlebars.SafeString Template._listColumnHeaders(returnData)


Handlebars.registerHelper 'listRow', () ->
