[Mpuls-commits] r446 - in waska/trunk: . waskaweb/controllers waskaweb/templates/casemanagement/evaluation

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 31 12:23:34 CEST 2009


Author: torsten
Date: 2009-03-31 12:23:33 +0200 (Tue, 31 Mar 2009)
New Revision: 446

Modified:
   waska/trunk/ChangeLog.txt
   waska/trunk/waskaweb/controllers/evaluate.py
   waska/trunk/waskaweb/templates/casemanagement/evaluation/evaluation_adele.mako
Log:
Added dropdown menu to select date for adele evaluation


Modified: waska/trunk/ChangeLog.txt
===================================================================
--- waska/trunk/ChangeLog.txt	2009-03-30 16:30:39 UTC (rev 445)
+++ waska/trunk/ChangeLog.txt	2009-03-31 10:23:33 UTC (rev 446)
@@ -1,3 +1,11 @@
+2009-03-31	Torsten Irlaender  <torsten.irlaender at intevation.de>
+
+	Added dropdown menu to select date for adele evaluation.
+
+	* waskaweb/controllers/evaluate.py,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_adele.mako:
+	  Added dropdown menu.
+
 2009-02-18	Torsten Irlaender  <torsten.irlaender at intevation.de>
 
 	Fixed issue 741

Modified: waska/trunk/waskaweb/controllers/evaluate.py
===================================================================
--- waska/trunk/waskaweb/controllers/evaluate.py	2009-03-30 16:30:39 UTC (rev 445)
+++ waska/trunk/waskaweb/controllers/evaluate.py	2009-03-31 10:23:33 UTC (rev 446)
@@ -32,6 +32,7 @@
 import paste
 import formencode
 from sets import Set
+from datetime import datetime
 from waskaweb.lib.sql_helper import range_compress 
 from waskaweb.lib.base import *
 from waskaweb.lib.evaluation import *
@@ -136,9 +137,26 @@
 
     def evaluateAdele(self):
         params = {}
-        params['start_date'] = '2008-09-01'
-        params['end_date']   = '2008-12-31'
+        params['start_date'] = '2009-01-01'
+        params['end_date']   = '2009-03-31'
+        c.select = 2
+        if request.params:
+            if request.params.get('timeframe') == '1':
+                params['start_date'] = '2008-09-01'
+                params['end_date']   = '2008-12-31'
+                c.select = 1
+            else:
+                params['start_date'] = '2009-01-01'
+                params['end_date']   = '2009-03-31'
+                c.select = 2
+
         params['agencyid']   = 'inte0002'
+
+        y,m,d = [int(i) for i in params['start_date'].split('-')]
+        c.start_date = datetime(y,m,d)
+        y,m,d = [int(i) for i in params['end_date'].split('-')]
+        c.end_date = datetime(y,m,d)
+
         evaluation = AdeleXML(params)
         c.eval = evaluation.perform()
         return render('casemanagement/evaluation/evaluation_adele.mako')

Modified: waska/trunk/waskaweb/templates/casemanagement/evaluation/evaluation_adele.mako
===================================================================
--- waska/trunk/waskaweb/templates/casemanagement/evaluation/evaluation_adele.mako	2009-03-30 16:30:39 UTC (rev 445)
+++ waska/trunk/waskaweb/templates/casemanagement/evaluation/evaluation_adele.mako	2009-03-31 10:23:33 UTC (rev 446)
@@ -6,7 +6,27 @@
   <li><a href="/case">${_('cm_np_root')}</a></li>
   <li><a href="/evaluate/evaluateAdele">Zwischenbericht</a></li>
 </%def>
-<h1>Auswertung Zwischenbericht vom 01.09.2008 bis zum 31.12.2008</h1>
+<h1>Auswertung Zwischenbericht vom ${h.dd_mm_YYYY(c.start_date)} bis zum ${h.dd_mm_YYYY(c.end_date)}</h1>
+<h2>Zeitraum</h2>
+<div>
+<form name="timeframe" action="/evaluate/evaluateAdele">
+<p>Bitte wählen Sie den Zeitraum, für den die Auswertung durchgeführt werden soll</p>
+<p>
+<select name="timeframe">
+  % if c.select == 1: 
+    <option value="1" selected>01.09.2008 - 31.12.2008</option>
+    <option value="2">01.01.2009 - 31.03.2009</option>
+  % else:
+    <option value="1">01.09.2008 - 31.12.2008</option>
+    <option value="2" selected>01.01.2009 - 31.03.2009</option>
+  % endif
+</select>
+<input type="submit" value="Auswerten">
+</p>
+</form>
+</div>
+&nbsp;<br>
+<hr>
 ##% for k, r in c.eval['evaluations'].iteritems():
 % for key in sorted([int(s) for s in c.eval['evaluations'].keys()]):
 <% r = c.eval['evaluations'][str(key)] %>



More information about the Mpuls-commits mailing list