 
 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]

# names in listFields.
Handlebars.registerHelper 'listColumnHeaders', (data) ->
	listFields = data.listFields
	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', () ->

	selected: () ->
		context = this.context
		single = context.single
		if Session.get("selected-#{single}") is this._id
			return 'alert-info'

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