[Mpuls-commits] r6135 - in waska/trunk/waskaweb: controllers templates/evaluation
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Thu Nov 1 17:02:21 CET 2012
Author: torsten
Date: 2012-11-01 17:02:21 +0100 (Thu, 01 Nov 2012)
New Revision: 6135
Modified:
waska/trunk/waskaweb/controllers/evaluate.py
waska/trunk/waskaweb/templates/evaluation/evaluate_extra.mako
Log:
Adapted variable names. Overwrite get_options function to return adele
specific options.
Modified: waska/trunk/waskaweb/controllers/evaluate.py
===================================================================
--- waska/trunk/waskaweb/controllers/evaluate.py 2012-11-01 16:00:09 UTC (rev 6134)
+++ waska/trunk/waskaweb/controllers/evaluate.py 2012-11-01 16:02:21 UTC (rev 6135)
@@ -1,5 +1,7 @@
+from pylons import session
from mpulsweb.controllers.evaluate import \
- EvaluateController as MpulsEvaluateController
+ EvaluateController as MpulsEvaluateController, \
+ get_common_options, get_default_adele_options, get_session_options
class EvaluateController(MpulsEvaluateController):
@@ -13,3 +15,15 @@
", ".join([str(e) for e in params['type_ending']])))
else:
return "TRUE"
+
+ def _get_options(self, id, evalconfig):
+ # If user selects adele-evaluation render page with different default
+ # options and no session options.
+ common_options = get_common_options(evalconfig, id,
+ session.get("evaluation_ids", ()))
+ if id == "0":
+ option_sources = [common_options, get_default_adele_options()]
+ else:
+ option_sources = [get_default_options(), common_options,
+ get_session_options()]
+ return option_sources
Modified: waska/trunk/waskaweb/templates/evaluation/evaluate_extra.mako
===================================================================
--- waska/trunk/waskaweb/templates/evaluation/evaluate_extra.mako 2012-11-01 16:00:09 UTC (rev 6134)
+++ waska/trunk/waskaweb/templates/evaluation/evaluate_extra.mako 2012-11-01 16:02:21 UTC (rev 6135)
@@ -1,23 +1,23 @@
## -*- coding: utf-8 -*-
-<%page args="adele_disabled"/>
+<%page args="disabled_options"/>
<tr>
<td class="label">${_('Kind of termination')}</td>
<td>
<input type="checkbox" value="-1" id="type_ending_-1" name="type_ending"
- ${adele_disabled} />
+ ${disabled_options} />
<label for="type_ending_-1">${_('Not specified')}</label><br/>
<input type="checkbox" value="-3" id="type_ending_-3" name="type_ending"
- ${adele_disabled} />
+ ${disabled_options} />
<label for="type_ending_-3">${_('Unknown')}</label><br/>
<input type="checkbox" value="2" id="type_ending_2" name="type_ending"
- ${adele_disabled} />
+ ${disabled_options} />
<label for="type_ending_2">${_('Advanced termination')}</label><br/>
<input type="checkbox" value="0" id="type_ending_0" name="type_ending"
- ${adele_disabled} />
+ ${disabled_options} />
<label for="type_ending_0">${_('Regular termination')}</label><br/>
<input type="checkbox" value="1" id="type_ending_1" name="type_ending"
- ${adele_disabled} />
+ ${disabled_options} />
<label for="type_ending_1">${_('Abort')}</label><br/>
</td>
</tr>
More information about the Mpuls-commits
mailing list