Diff for /MPIWGWeb/MPIWGProjects.py between versions 1.47.2.9 and 1.47.2.12

version 1.47.2.9, 2005/06/05 22:06:35 version 1.47.2.12, 2005/06/08 20:13:17
Line 418  class MPIWGRoot(ZSQLExtendFolder): Line 418  class MPIWGRoot(ZSQLExtendFolder):
   
     def getProjectsByFieldContent(self,fieldName,fieldContentsEntry):      def getProjectsByFieldContent(self,fieldName,fieldContentsEntry):
         """gib alle Projekte aus mit Value von field mit fieldName enthält ein Element der Liste fieldContents"""          """gib alle Projekte aus mit Value von field mit fieldName enthält ein Element der Liste fieldContents"""
           def sort(x,y):
           return cmp(x.WEB_title[0],y.WEB_title[0])
   
         if type(fieldContentsEntry) is StringType:          if type(fieldContentsEntry) is StringType:
             fieldContents=[fieldContentsEntry]              fieldContents=[fieldContentsEntry]
         else:          else:
Line 425  class MPIWGRoot(ZSQLExtendFolder): Line 428  class MPIWGRoot(ZSQLExtendFolder):
                           
         projects=self.ProjectCatalog({fieldName:string.join(fieldContents,' OR')})          projects=self.ProjectCatalog({fieldName:string.join(fieldContents,' OR')})
         #print projects          #print projects
         return projects      ret=[x for x in projects]
       ret.sort(sort)
           return ret
   
     def changeMPIWGRootForm(self):      def changeMPIWGRootForm(self):
         """edit"""          """edit"""
Line 444  class MPIWGRoot(ZSQLExtendFolder): Line 449  class MPIWGRoot(ZSQLExtendFolder):
   
     def getDisciplineList(self):      def getDisciplineList(self):
         """get disciplines as list"""          """get disciplines as list"""
         return self.disciplineList.split("\n")          list= self.disciplineList.split("\n")
           return [x.rstrip().lstrip() for x in list]
           
     def getThemeList(self):      def getThemeList(self):
         """get themes as list"""          """get themes as list"""
         return self.themesList.split("\n")          list= self.themesList.split("\n")
           return [x.rstrip().lstrip() for x in list]
           
     def test(self):      def test(self):
         """test"""          """test"""
Line 639  class MPIWGRoot(ZSQLExtendFolder): Line 646  class MPIWGRoot(ZSQLExtendFolder):
                     #title=project[0].WEB_title                      #title=project[0].WEB_title
                     title=[project[0].getContent('WEB_title')]                      title=[project[0].getContent('WEB_title')]
                     #print title                      #print title
               if idNr[0]!="x":
                     returnList.append((depth,nr,title,project[0]))                      returnList.append((depth,nr,title,project[0]))
                   
         return returnList          return returnList
Line 652  class MPIWGRoot(ZSQLExtendFolder): Line 660  class MPIWGRoot(ZSQLExtendFolder):
             if (element[0]>actualDepth):              if (element[0]>actualDepth):
                 #fuege soviele ul ein wie unterschied in tiefe                  #fuege soviele ul ein wie unterschied in tiefe
                 if element[0]==1:                  if element[0]==1:
                     ret+="""<div class="dept">\n<ul>\n"""                      ret+="""<div class="dept">\n<ul class="liste">\n"""
                 else:                  else:
                     for i in range(element[0]-actualDepth):                      for i in range(element[0]-actualDepth):
                         ret+="</li>\n<li><ul>\n"                          if i>0:
                               ret+="<li>"
                           ret+="""<ul class="liste">\n"""
                                           
                 actualDepth=element[0]                  actualDepth=element[0]
                                   
             elif (element[0]<actualDepth):              elif (element[0]<actualDepth):
                 #fuege soviele /ul ein wie unterschied in tiefe                  #fuege soviele /ul ein wie unterschied in tiefe
                 for i in range(-element[0]+actualDepth):                  for i in range(-element[0]+actualDepth):
                     ret+="<br><br></li></ul></li>\n"  
                       ret+="<br><br></li></ul>\n"
   
                       #ret+="<br><br>\n</li>\n</ul>\n</li>\n"
   
   
                 if element[0]==1:                  if element[0]==1:
                     department=int(element[3].getContent('xdata_05'))-1                      department=int(element[3].getContent('xdata_05'))-1
                                           
                     ret+="""</div>\n"""                      ret+="""</ul></div>\n"""
               if department==4: #hack
               department=3
   
                     ret+="""<div class="bildspalte"><img src="../grafik/dept%i.jpg" width="160" height="120" vspace="40"></div>                      ret+="""<div class="bildspalte"><img src="../grafik/dept%i.jpg" width="160" height="120" vspace="40"></div>
                     <div class="dept">\n<ul>\n                      <div class="dept">\n<ul class="liste">\n
                     """%department                      """%department
                           
                 actualDepth=element[0]                  actualDepth=element[0]
             else:              else:
                 ret+="""</li>\n"""                  ret+="""\n</li>\n"""
             ret+="""<li>\n"""              ret+="""<li>\n"""
                           
             if actualDepth==1:              if actualDepth==1:
                 departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'NWG','5':'NWG'}                   departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'Ind. Research Group','5':'Ind. Research Group'} 
                 department=element[3].getContent('xdata_05')                  department=element[3].getContent('xdata_05')
                 ret+="""<img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department])                  ret+="""<a href="#top"><img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department])
   
             ret+="""<a href="%s">%s</a>"""%(self.generateUrlProject(element[3].absolute_url())+"/index.html",element[3].getContent('WEB_title'))              ret+="""<a href="%s">%s</a>"""%(self.generateUrlProject(element[3].absolute_url())+"/index.html",element[3].getContent('WEB_title'))
         return ret          return ret
Line 1192  class MPIWGProject(CatalogAware,Folder): Line 1209  class MPIWGProject(CatalogAware,Folder):
             splitted=text2.split("""<p class="picture">""")              splitted=text2.split("""<p class="picture">""")
             if len(splitted)>1:              if len(splitted)>1:
                 tmp=splitted[1].split("</p>")                  tmp=splitted[1].split("</p>")
                 self.REQUEST.SESSION['image']=tmp[0].split("\"")[1].encode('utf-8')          #return repr(splitted[1])
                   try:
               self.imageURL=tmp[0].split("\"")[1].encode('utf-8')
           except:
               self.imageURL=tmp[0].split("src=")[1].split(" ")[0].encode('utf-8')
           
                 split2="</p>".join(tmp[1:])                  split2="</p>".join(tmp[1:])
   
                 text3=splitted[0]+split2                  text3=splitted[0]+split2
Line 1200  class MPIWGProject(CatalogAware,Folder): Line 1222  class MPIWGProject(CatalogAware,Folder):
                 splitted=text3.split("""<p class="picturetitle">""")                  splitted=text3.split("""<p class="picturetitle">""")
                 if len(splitted)>1:                  if len(splitted)>1:
                     tmp=splitted[1].split("</p>")                      tmp=splitted[1].split("</p>")
                     self.REQUEST.SESSION['imagecap']=tmp[0].encode('utf-8')              self.imagecap=tmp[0].encode('utf-8')
                   
                     split4="".join(tmp[1:])                      split4="".join(tmp[1:])
   
                     text5=splitted[0]+split4                      text5=splitted[0]+split4
Line 1215  class MPIWGProject(CatalogAware,Folder): Line 1238  class MPIWGProject(CatalogAware,Folder):
   
         #teste ob WEB_project_description und keine führenden p tags          #teste ob WEB_project_description und keine führenden p tags
         if (len(text5)>4) and (not text5[0:3]=='<p>') and (field=='WEB_project_description'):          if (len(text5)>4) and (not text5[0:3]=='<p>') and (field=='WEB_project_description'):
             return "<p>"+text5+"</p>"              text5= "<p>"+text5+"</p>"
   
   
         #filter image          #filter image
Line 1292  class MPIWGProject(CatalogAware,Folder): Line 1315  class MPIWGProject(CatalogAware,Folder):
         else:          else:
             splitted=list[0].split(";")              splitted=list[0].split(";")
   
           splitted=[y.rstrip().lstrip() for y in splitted]
   
         for x in splitted:          for x in splitted:
             if (not x==u'') and x in wert:              if (not x==u'') and x in wert:

Removed from v.1.47.2.9  
changed lines
  Added in v.1.47.2.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>