Mercurial > pub > site.implab
diff shared_view/includes/dojo/form.tt @ 11:573272ec604b
almost comlete doxygen library
author | sergey |
---|---|
date | Thu, 15 May 2014 18:24:02 +0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/shared_view/includes/dojo/form.tt Thu May 15 18:24:02 2014 +0400 @@ -0,0 +1,21 @@ +[% + 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> \ No newline at end of file