[Mpuls-commits] r1518 - in wasko/branches/2.0: mpulsweb/controllers waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Feb 11 11:16:51 CET 2010
Author: torsten
Date: 2010-02-11 11:16:51 +0100 (Thu, 11 Feb 2010)
New Revision: 1518
Added:
wasko/branches/2.0/mpulsweb/controllers/annotations.py
Removed:
wasko/branches/2.0/waskaweb/controllers/annotations.py
Log:
Moved controller for annotations to mpulsbase
Copied: wasko/branches/2.0/mpulsweb/controllers/annotations.py (from rev 1516, wasko/branches/2.0/waskaweb/controllers/annotations.py)
Property changes on: wasko/branches/2.0/mpulsweb/controllers/annotations.py
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: wasko/branches/2.0/waskaweb/controllers/annotations.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/annotations.py 2010-02-11 10:16:14 UTC (rev 1517)
+++ wasko/branches/2.0/waskaweb/controllers/annotations.py 2010-02-11 10:16:51 UTC (rev 1518)
@@ -1,57 +0,0 @@
-import logging
-
-from pylons import g
-from pylons.i18n import _
-from pylons import c
-from pylons.controllers.util import abort
-
-from mpulsweb.lib.security import checkRole
-from mpulsweb.lib.base import BaseController, render
-
-log = logging.getLogger(__name__)
-
-
-class AnnotationsController(BaseController):
-
- @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
- def help(self, id):
- """Show help for the given id.
- The id is first looked up in the formed tree, because its node
- components also have a description that can be used as a title.
- However, not all help texts refer to formed tree components (for
- instances 'wiederaufnahme' and 'neuaufnahme'), so helpData is
- searched directly as well.
- """
- nc = g.formedTree.findByName(id)
- if nc is not None:
- text = nc.getHelp()
- title = nc.getDescription()
- else:
- text = g.helpData.getHelp(id)
- if text is None:
- abort(404, _('No help available'))
- title = ""
- c.annotation_header = _('Help')
- c.annotation_title = title
- c.annotation_text = text
- return render('/annotations/annotation.mako')
-
- @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
- def required(self, id):
- nc = g.formedTree.findByName(id)
- if not nc:
- abort(404, _('No help available'))
- c.annotation_header = _('Required field')
- c.annotation_title = nc.getDescription()
- c.annotation_text = nc.getRequired()
- return render('/annotations/annotation.mako')
-
- @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
- def evaluation(self, id):
- nc = g.formedTree.findByName(id)
- if not nc:
- abort(404, _('No help available'))
- c.annotation_header = _('Evaluation relevant field')
- c.annotation_title = nc.getDescription()
- c.annotation_text = nc.getEvaluation()
- return render('/annotations/annotation.mako')
More information about the Mpuls-commits
mailing list