diff shared_view/includes/form/box.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/form/box.tt	Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,45 @@
+[% 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>
\ No newline at end of file