Mercurial > hg > MPIWGThesaurus
changeset 28:30dee40ff84b
thesaurus for new version of the website
author | dwinter |
---|---|
date | Fri, 24 May 2013 16:15:32 +0200 |
parents | aac892c55535 |
children | 417b6c14057b |
files | MPIWGThesaurus.py zpt/Copy of levelFormatted.zpt zpt/levelFormatted.zpt |
diffstat | 3 files changed, 99 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/MPIWGThesaurus.py Sun May 05 13:55:26 2013 +0200 +++ b/MPIWGThesaurus.py Fri May 24 16:15:32 2013 +0200 @@ -652,7 +652,11 @@ return pt(level1_entries=entries,type=formatType) - return self.levelFormatted(level1_entries=entries,type=formatType) + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','levelFormatted.zpt')).__of__(self) + return pt(level1_entries=entries,type=formatType) + + + #return self.levelFormatted(level1_entries=entries,type=formatType) def getEntries(self,entry): logging.debug("GETENTRY:"+repr(entry)) @@ -1324,6 +1328,8 @@ list.append(self.getProjectDetails(projectID)) ret[object]=list[0:] + + logging.debug(ret) return ret security.declareProtected('View management screens','listAllSuggestedTags') @@ -1489,7 +1495,7 @@ return ret def getProjectDetails(self,getID): - project=getattr(self.www_neu.projects,getID,None) + project=getattr(self.projects,getID,None) if project is None: logging.debug("no project!! " +getID) return @@ -1500,7 +1506,10 @@ #persons=project.getPersonKeyList() persons=project.getContent('xdata_01') logging.debug("%s %s %s"%(link,title,persons)) - return link,title,persons + + thumb = project.getThumbUrl() + + return link,title,persons,thumb # $.post("addNewPerson",{"projectID": # $('#projectID').val(),
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/Copy of levelFormatted.zpt Fri May 24 16:15:32 2013 +0200 @@ -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
--- a/zpt/levelFormatted.zpt Sun May 05 13:55:26 2013 +0200 +++ b/zpt/levelFormatted.zpt Fri May 24 16:15:32 2013 +0200 @@ -1,31 +1,65 @@ <!-- exmample for level template --> - -<div class="level1" tal:repeat="level1 +<ul> +<tal:x 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> + +<li class="level_1 indent showApproach"><img tal:attributes="src string:en/images/foldout_open.png"/> + <span tal:content="python:here.getTitle(level1) +'('+ str(len(here.getProjectsWithTag(options['type'],here.getTitle(level1)))) +')' ">Lorem</span> +</li> + + <li class="li_project projectsWindow"> + <table class="items"> + <tr class="line" tal:repeat="proj + python:here.getProjectsWithTag(options['type'],here.getTitle(level1))"> + + <tal:x on-error="python:'ERROR'"> + + <td><a tal:attributes="href python:proj[0]"><img class="thumb" tal:define="imgUrl python:proj[3]" tal:condition="imgUrl" tal:attributes="src imgUrl"/></a></td> + <td><a tal:condition="python:proj!=None" tal:attributes="href + python:proj[0]"><span + tal:replace="python:proj[1]">my proj</span></a> + <tal:x define="person python:proj[2]"><span + class="person_projects" tal:content="person"/></tal:x> + </td> + </tal:x> + </tr> + </table> + </li> + <tal:y condition="python:len(here.getEntries(level1))>0"> - - <div class="level2" tal:repeat="level2 + <tal:x 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"> + + <tal:x define="subitems + python:here.getProjectsWithTag(options['type'],here.getTitle(level1)+'_'+here.getTitle(level2))" + condition="python:len(subitems)>0"> + + <li class="level_2 indent" ><img tal:attributes="src string:en/images/foldout_open.png"/> <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> - + </li> + <li class="level2 indent li_project projectsWindow"> + <table class="items "> + <tr class="line" tal:repeat="proj + python:here.getProjectsWithTag(options['type'],here.getTitle(level1))"> + + <tal:x on-error="python:'ERROR'"> + + <td><a tal:attributes="href python:proj[0]"><img class="thumb" tal:define="imgUrl python:proj[3]" tal:condition="imgUrl" tal:attributes="src imgUrl"/></a></td> + <td><a tal:condition="python:proj!=None" tal:attributes="href + python:proj[0]"><span + tal:replace="python:proj[1]">my proj</span></a> + <tal:x define="person python:proj[2]"><span + class="person_projects" tal:content="person"/></tal:x> + </td> </tal:x> - </div> + </tr> + </table> + </li> + </tal:x> + </tal:x> + </tal:y> -</div> \ No newline at end of file +</tal:x> +</ul> \ No newline at end of file