[Mpuls-commits] r3648 - in base/trunk: . mpulsweb/controllers mpulsweb/templates/casebundle/dialogs mpulsweb/templates/casemanagement
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Sep 15 13:15:49 CEST 2010
Author: bh
Date: 2010-09-15 13:15:47 +0200 (Wed, 15 Sep 2010)
New Revision: 3648
Added:
base/trunk/mpulsweb/templates/casebundle/dialogs/success_markevaluate.mako
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/controllers/case_bundle.py
base/trunk/mpulsweb/templates/casemanagement/overview.mako
Log:
* mpulsweb/controllers/case_bundle.py
(CaseBundleController.bundleAction): Handle "evaluate" action.
Stores the list of selected ids in the session under the key
"evaluation_ids"
* mpulsweb/templates/casebundle/dialogs/success_markevaluate.mako:
New. Success-dialog for the evaluate bundle action
* mpulsweb/templates/casemanagement/overview.mako: Add action
"evaluate" if the evaluation module is activated.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-09-15 10:08:31 UTC (rev 3647)
+++ base/trunk/ChangeLog 2010-09-15 11:15:47 UTC (rev 3648)
@@ -1,3 +1,16 @@
+2010-09-15 Bernhard Herzog <bh at intevation.de>
+
+ * mpulsweb/templates/casemanagement/overview.mako: Add action
+ "evaluate" if the evaluation module is activated.
+
+ * mpulsweb/controllers/case_bundle.py
+ (CaseBundleController.bundleAction): Handle "evaluate" action.
+ Stores the list of selected ids in the session under the key
+ "evaluation_ids"
+
+ * mpulsweb/templates/casebundle/dialogs/success_markevaluate.mako:
+ New. Success-dialog for the evaluate bundle action
+
2010-09-15 Roland Geider <roland.geider at intevation.de>
* mpulsweb/public/styles/all.css,
Modified: base/trunk/mpulsweb/controllers/case_bundle.py
===================================================================
--- base/trunk/mpulsweb/controllers/case_bundle.py 2010-09-15 10:08:31 UTC (rev 3647)
+++ base/trunk/mpulsweb/controllers/case_bundle.py 2010-09-15 11:15:47 UTC (rev 3648)
@@ -172,6 +172,30 @@
if export_format in ("XML", "CSV", "XLS"):
return self.export(export_format)
+ if action == 'evaluate':
+ case_bundle = self._filterBundle(case_bundle, (1, 4, 5))
+ if case_bundle.isEmpty():
+ return self._emptyListError()
+
+ session['casebundle'] = case_bundle
+ session["evaluation_ids"] = case_bundle.listDatasetIds()
+ session.save()
+ c.url_ok = url_for(controller='/case_overview')
+ num = len(case_bundle)
+ c.dialog_title= ungettext("Case was marked for evaluation",
+ "Cases were marked for evaluation",
+ num)
+ c.dialog_text = \
+ ungettext("%d case was marked for evaluation."
+ " All following evaluations will be limited"
+ " to that case. Click 'OK' to continue.",
+ "%d cases were marked for evaluation."
+ " All following evalutations will be limited"
+ " to those cases. Click 'OK' to continue.",
+ num) % num
+
+ return render('/casebundle/dialogs/success_markevaluate.mako')
+
except formencode.Invalid, error:
log.exception(error)
raise
Added: base/trunk/mpulsweb/templates/casebundle/dialogs/success_markevaluate.mako
===================================================================
--- base/trunk/mpulsweb/templates/casebundle/dialogs/success_markevaluate.mako 2010-09-15 10:08:31 UTC (rev 3647)
+++ base/trunk/mpulsweb/templates/casebundle/dialogs/success_markevaluate.mako 2010-09-15 11:15:47 UTC (rev 3648)
@@ -0,0 +1,8 @@
+## -*- coding: utf-8 -*-
+<%inherit file="/main.mako" />
+<%def name="buildNavipath()">
+ ${parent.buildNavipath()}
+ <li><a href="${h.url_for(controller='/case')}">${_('cm_np_root')}</a></li>
+ <li><a href="#">${_("Mark cases for evaluation")}</a></li>
+</%def>
+<%include file="../../dialogs/success.mako" />
Modified: base/trunk/mpulsweb/templates/casemanagement/overview.mako
===================================================================
--- base/trunk/mpulsweb/templates/casemanagement/overview.mako 2010-09-15 10:08:31 UTC (rev 3647)
+++ base/trunk/mpulsweb/templates/casemanagement/overview.mako 2010-09-15 11:15:47 UTC (rev 3648)
@@ -59,6 +59,9 @@
% if g.mpuls_config.is_enabled('case-module', 'exportCSV'):
<option value="exportCSV">Als CSV-Datei exportieren</option>
% endif
+ % if g.mpuls_config.is_enabled('module', 'evaluation'):
+ <option value="evaluate">Auswerten</option>
+ % endif
</select>
</div>
<div class="waska_form_element w50">
More information about the Mpuls-commits
mailing list