[Mpuls-commits] r2313 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Apr 12 16:49:25 CEST 2010


Author: torsten
Date: 2010-04-12 16:49:23 +0200 (Mon, 12 Apr 2010)
New Revision: 2313

Modified:
   wasko/branches/2.0/mpulsweb/lib/renderer.py
Log:
* mpulsweb/lib/renderer.py (is_evaluation_relevant): New function wich
	returns true if the substring "evaluation:" is found in a given string.
* mpulsweb/lib/renderer.py (ViewRenderer._renderAttributes): Render
	icons for required-fields and evaluation relevant fields based on the
	info in the formedtree rather then looking for an available entry in
	the annotationsfile.


Modified: wasko/branches/2.0/mpulsweb/lib/renderer.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/renderer.py	2010-04-12 14:38:12 UTC (rev 2312)
+++ wasko/branches/2.0/mpulsweb/lib/renderer.py	2010-04-12 14:49:23 UTC (rev 2313)
@@ -54,6 +54,9 @@
 def is_required(flags):
     return flags.find("required:") >= 0
 
+def is_evaluation_relevant(flags):
+    return flags.find("evaluation:") >= 0
+
 def digits(n):
     d, c = 10, 1
     while n >= d:
@@ -311,14 +314,14 @@
                            target="_blank"))
             out.append('<img src="/images/icons/formular/help.png" alt="help">')
             out.append('</a>')
-        if meta.hasRequired():
+        if is_required(meta.getFlags()):
             out.append(tag("a",
                            href="/annotations/required/%s" % meta.getName(),
                            target="_blank"))
             out.append('<img src="/images/icons/formular/required.png"'
                        ' alt="required">')
             out.append('</a>')
-        if meta.hasEvaluation():
+        if is_evaluation_relevant(meta.getFlags()):
             out.append(tag("a",
                            href="/annotations/evaluation/%s" % meta.getName(),
                            target="_blank"))



More information about the Mpuls-commits mailing list