[Mpuls-commits] r549 - in wasko/trunk: . waskaweb/controllers waskaweb/templates waskaweb/templates/annotations

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 28 09:42:08 CEST 2009


Author: torsten
Date: 2009-07-28 09:42:07 +0200 (Tue, 28 Jul 2009)
New Revision: 549

Added:
   wasko/trunk/waskaweb/controllers/annotations.py
   wasko/trunk/waskaweb/templates/annotations/
   wasko/trunk/waskaweb/templates/annotations/annotation.mako
Modified:
   wasko/trunk/ChangeLog.txt
Log:
Make the annotations work again


Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-07-28 07:31:23 UTC (rev 548)
+++ wasko/trunk/ChangeLog.txt	2009-07-28 07:42:07 UTC (rev 549)
@@ -47,6 +47,13 @@
 	  formed/formedtree_web.xml: Lots of new files. Copied from mpuls-ng
 	  and adapted to code to work within wasko. 
 
+	Make the annotations work again
+
+	* waskaweb/templates/annotations,
+	  waskaweb/templates/annotations/annotation.mako,
+	  waskaweb/controllers/annotations.py: Copied new controller and
+	  template from mpuls-ng.
+
 2009-07-16	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	Set version to 1.0.5

Added: wasko/trunk/waskaweb/controllers/annotations.py
===================================================================
--- wasko/trunk/waskaweb/controllers/annotations.py	2009-07-28 07:31:23 UTC (rev 548)
+++ wasko/trunk/waskaweb/controllers/annotations.py	2009-07-28 07:42:07 UTC (rev 549)
@@ -0,0 +1,40 @@
+import logging
+
+from pylons import g
+from pylons.i18n import _
+from pylons import request, response, session, c
+from pylons.controllers.util import abort, redirect_to
+
+from waskaweb.lib.security         import checkRole
+from waskaweb.lib.base import BaseController, render
+
+log = logging.getLogger(__name__)
+
+class AnnotationsController(BaseController):
+
+    @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
+    def help(self, id):
+        nc = g.formedTree.findByName(id)
+        if not nc: return abort('404', _('No help available'))
+        c.annotation_header =  _('Help') 
+        c.annotation_title  =  nc.getDescription()
+        c.annotation_text   =  nc.getHelp()
+        return render('/annotations/annotation.mako')
+
+    @checkRole(('admin_ka', 'cm_ka', 'pt_dlr'))
+    def required(self, id):
+        nc = g.formedTree.findByName(id)
+        if not nc: return 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: return 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')

Added: wasko/trunk/waskaweb/templates/annotations/annotation.mako
===================================================================
--- wasko/trunk/waskaweb/templates/annotations/annotation.mako	2009-07-28 07:31:23 UTC (rev 548)
+++ wasko/trunk/waskaweb/templates/annotations/annotation.mako	2009-07-28 07:42:07 UTC (rev 549)
@@ -0,0 +1,5 @@
+## -*- coding: utf-8 -*-
+<%inherit file="../main_help.mako" />
+<h1>${c.annotation_header}</h1>
+<h2>${c.annotation_title}</h2>
+<p>${c.annotation_text}</p>



More information about the Mpuls-commits mailing list