[Mpuls-commits] r301 - in wasko/trunk: . waskaweb/model waskaweb/templates/casemanagement

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 25 16:12:32 CET 2009


Author: teichmann
Date: 2009-02-25 16:12:29 +0100 (Wed, 25 Feb 2009)
New Revision: 301

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/model/phases_factory.py
   wasko/trunk/waskaweb/templates/casemanagement/phase.mako
Log:
Render number of missing fields for phases in phase overview.
Removed isYoungerThan() from phase activation in phase overview.



Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-02-25 14:52:45 UTC (rev 300)
+++ wasko/trunk/ChangeLog.txt	2009-02-25 15:12:29 UTC (rev 301)
@@ -1,5 +1,13 @@
 2009-02-25	Sascha L. Teichmann <teichmann at intevation.de>
 
+	* waskaweb/model/phases_factory.py: Render number of missing
+	  fields for phases in phase overview.
+
+	* waskaweb/templates/casemanagement/phase.mako: Removed 
+	  isYoungerThan() from phase activation.
+
+2009-02-25	Sascha L. Teichmann <teichmann at intevation.de>
+
 	* waskaweb/model/casedocument.py: Suppress traceback output if
 	  rule evalution fails. Fixed problem with missing dates in
 	  phase overview.

Modified: wasko/trunk/waskaweb/model/phases_factory.py
===================================================================
--- wasko/trunk/waskaweb/model/phases_factory.py	2009-02-25 14:52:45 UTC (rev 300)
+++ wasko/trunk/waskaweb/model/phases_factory.py	2009-02-25 15:12:29 UTC (rev 301)
@@ -163,19 +163,22 @@
                 tree_item = navigation.findTreeItemByPageName(p_name)
                 if not tree_item: continue
                 tree_item = tree_item.deepest_item()
-                t = [tree_item, False]
+                t = [tree_item, 0]
                 pages.append(t)
                 used_pages[p_name] = t
 
             if var.getName() in missing_set:
-                t[1] = True
+                t[1] += 1
 
         out = []
-        for tree_item, miss in pages:
+        for tree_item, misses in pages:
             #print >> sys.stderr, "page: %s %s" % (tree_item.name, miss)
-            warn = miss and 'class="required_missing"' or ''
-            out.append('<a href=%s %s>%s' % (
-                link(tree_item), warn, escape(tree_item.description).replace(' ', '&nbsp;')))
+            warn, errors = misses and ('class="required_missing"', (" (%d)" % misses)) or ("", "")
+            out.append('<a href=%s %s title="%s">%s' % (
+                link(tree_item),
+                warn,
+                (misses and u"Anzahl der fehlenden Felder in Klammern" or u"Phase vollständig"),
+                escape(tree_item.description + errors).replace(' ', '&nbsp;')))
 
         return u",</a> ".join(out) + (out and "</a>" or "")
 

Modified: wasko/trunk/waskaweb/templates/casemanagement/phase.mako
===================================================================
--- wasko/trunk/waskaweb/templates/casemanagement/phase.mako	2009-02-25 14:52:45 UTC (rev 300)
+++ wasko/trunk/waskaweb/templates/casemanagement/phase.mako	2009-02-25 15:12:29 UTC (rev 301)
@@ -45,7 +45,7 @@
       <td>${h.dd_mm_YYYY(p1.getTime(), '-/-')}</td>
       <td style="text-align:right">
         % if is_allowed:
-            % if (p1.isRecursiveComplete() and not p1.isRunning() and (p1.isNeighbor(c.current_phase) or c.current_phase.hasPredecessor(p1))) or not session.get('case').isYoungerThan('2008-09-01'):
+            % if (p1.isRecursiveComplete() and not p1.isRunning() and (p1.isNeighbor(c.current_phase) or c.current_phase.hasPredecessor(p1))):
                 <input type="submit" value="Start" name="${p1.getLabel()|h}">
             % else:
                 <input type="submit" value="Start" name="${p1.getLabel()|h}"
@@ -66,7 +66,7 @@
       <td class="table_row_h">${h.dd_mm_YYYY(p2.getTime(), '-/-')}</td>
       <td style="text-align:right" class="table_row_h">
         % if is_allowed:
-            % if (p2.isRecursiveComplete() and not p2.isRunning() and p2.isNeighbor(c.current_phase) and not c.current_phase.hasPredecessor(p2)) or not session.get('case').isYoungerThan('2008-09-01'):
+            % if (p2.isRecursiveComplete() and not p2.isRunning() and p2.isNeighbor(c.current_phase) and not c.current_phase.hasPredecessor(p2)):
                 <input type="submit" value="Ende" name="${p2.getLabel()|h}">
             % else:
                 <input type="submit" value="Ende" name="${p2.getLabel()|h}" 



More information about the Mpuls-commits mailing list