changeset 176:8dd7305fbc2d

moved get_form_error to base
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 21 May 2010 20:37:34 +0200
parents d69e19fc2795
children 93bd77e1f3c1
files pylons_app/templates/base/base.html
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/templates/base/base.html	Fri May 21 20:37:09 2010 +0200
+++ b/pylons_app/templates/base/base.html	Fri May 21 20:37:34 2010 +0200
@@ -99,4 +99,15 @@
 
 <%def name="js()">
 <script type="text/javascript" src="/js/yui/utilities/utilities.js"></script>
+</%def>
+
+<!-- DEFINITION OF FORM ERROR FETCHER -->
+<%def name="get_form_error(element)">
+	%if hasattr(c,'form_errors') and type(c.form_errors) == dict:
+        %if c.form_errors.get(element,False):
+            <span class="error-message">
+                ${c.form_errors.get(element,'')}
+            </span>
+        %endif
+	%endif           
 </%def>
\ No newline at end of file