 
 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]


		# Template._listForm.helpers(data.form.helpers)

		Template._listRow.events(data.row.events)
		if data.row?.helpers?
			Template._listRow.helpers(data.row.helpers)

		Template.lists.events(data.list.events)



		items = []
		for item in data.items()
			data = Object.reject(data, 'items')
			item.context = data
			items.add item

		if items.length > 0
			return items

Template._listRow.helpers
	disabled: () ->

# 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', () ->
