view shared_view/includes/form/box.tt @ 12:d9551c7e7101

improved dox library
author sergey
date Fri, 16 May 2014 16:47:50 +0400
parents 573272ec604b
children
line wrap: on
line source

[% labels(
	InvalidForm = 'Invalid form data, please review.'
)%]
[% MACRO element(control) BLOCK;
	ers = control.GetOwnErrors().join(', ');
%]
<div class='input-control'>
	<div class='control-label'>
		[% control.label %][% IF ers %] <span class="control-errors">$ers</span>[% END %]
	</div>
	<div class='control-content'>
		[% display_model(control, path = control.name) %]
	</div>
</div>
[% END %]
[% BLOCK CONTENT %]
	[% element(prop) FOREACH prop IN metadata.GetProperties() %]
[% END %]
[% BLOCK FOOTER %]
	[% render('dojo/form/Button', button) FOREACH button IN buttons %]
[% END %]
<script type="dojo/on" data-dojo-event="submit">
	if(!this.validate()){
    	alert('$InvalidForm');
        return false;
    }
    return true;
</script>
<div class="box-form">
    <div class="title">$document.title</div>
    <div class="content">
		<div class="group-control">
			[% FOR error IN metadata.GetOwnErrors() %]
			<div class="control-errors">$error</div>
			[% END %]
			<div class="control-content">
		    	[% INCLUDE CONTENT %]
		    	<br style="clear:both">
		    </div>
		    <div class="form-footer">
				[% INCLUDE FOOTER %]
			</div>
		</div>
    </div>
</div>