changeset 13:51ed6ad43383

template for the levels in overview added in zpt
author dwinter
date Fri, 13 Jan 2012 09:19:08 +0100
parents e7733b6ba343
children a85d5f111592
files MPIWGThesaurus.py zpt/levelFormatted.zpt
diffstat 2 files changed, 34 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGThesaurus.py	Fri Jan 13 09:14:38 2012 +0100
+++ b/MPIWGThesaurus.py	Fri Jan 13 09:19:08 2012 +0100
@@ -480,7 +480,9 @@
     def getEntriesFormatted(self,entries,type):
         errorString="<H1>template with name <em>levelFormatted</em> does not exist in the thesaurus folder!"
         if not hasattr(self,'levelFormatted'):
-            return errorString
+              pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','levelFormatted.zpt')).__of__(self)
+              return pt(level1_entries=entries,type=type)
+    
         
         return self.levelFormatted(level1_entries=entries,type=type)
         
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/levelFormatted.zpt	Fri Jan 13 09:19:08 2012 +0100
@@ -0,0 +1,31 @@
+<!--  exmample for level template -->
+
+<div class="level1"  tal:repeat="level1
+					     python:options['level1_entries']">
+  <span class="showApproach" tal:content="python:here.getTitle(level1) +'('+ str(len(here.getProjectsWithTag(options['type'],here.getTitle(level1)))) +')' ">Lorem</span>
+  <div class="projectsWindow">
+    <div class="level1_projects" tal:repeat="proj
+					     python:here.getProjectsWithTag(options['type'],here.getTitle(level1))"><a tal:attributes="href
+																       python:proj[0]"><span tal:content="python:proj[1]">my proj</span></a><tal:x define="person python:proj[2]"><span 
+																														     class="person_projects" tal:content="person"/></tal:x></div>
+  </div>
+  <tal:y condition="python:len(here.getEntries(level1))>0">
+    
+    <div class="level2" tal:repeat="level2
+				    python:here.getEntries(level1)">
+      <tal:x define="subitems
+		     python:here.getProjectsWithTag(options['type'],here.getTitle(level1)+'_'+here.getTitle(level2))"
+	     condition="python:len(subitems)>0">
+	<span class="showApproach"
+	      tal:content="python:here.getTitle(level2) +'
+			   ('+str(len(subitems))+')'">Lor</span>
+	<div  class="projectsWindow">
+	  <div class="level2_projects" tal:repeat="proj python:subitems">
+	    <a tal:attributes="href python:proj[0]"><span tal:content="python:proj[1]">my proj</span></a>
+	    <tal:x define="person python:proj[2]"><span class="person_projects"  tal:content="person"/></tal:x></div>
+	</div>
+	
+      </tal:x>
+    </div>
+  </tal:y>
+</div>
\ No newline at end of file