view shared_view/includes/dojo/form.tt @ 16:e69c970c3ddd default tip

sync
author sergey
date Tue, 20 May 2014 01:28:48 +0400
parents 573272ec604b
children
line wrap: on
line source

[%
	BLOCK INIT;
		document.dojo.modules.push("dijit/form/Form");
	END;
	
	FormResult = import('IMPL::Web::View::FormResult');
	Metadata = import('IMPL::Web::View::Metadata::FormMeta');
	
	UNLESS is(model,FormResult);
		THROW form 'The form result is required';
	END;
	
	# defaults
	content = layout.content || 'form/group';
	enctype = enctype || 'application/x-www-form-urlencoded';
	method = method || 'POST';
	formMeta = Metadata.GetMetadataForModel(model.node, errors = model.errors, nodes = [model.node]);
 %]
<form data-dojo-type="dijit/form/Form" class="form-control" method="$method" [% IF action %]action="$action" [% END %] enctype="$enctype">
	[% display_model(formMeta, content, layout.args) %]
</form>