changeset 159:ee79f6ba8d01

clean up staff editing and some zpt forms.
author casties
date Thu, 06 Jun 2013 15:34:20 +0200
parents 86a5b3c4af4b
children 05f02b7aaa2f
files MPIWGFolder.py MPIWGHelper.py MPIWGLink.py MPIWGRoot.py MPIWGStaff.py zpt/AddMPIWGFolder.zpt zpt/AddMPIWGLink.zpt zpt/MPIWGFolderConfig.zpt zpt/MPIWGLinkChange.zpt zpt/addMPIWGRootForm.zpt zpt/addMPIWGStaffFolderForm.zpt zpt/addMPIWGStaffForm.zpt zpt/changeMPIWGRootForm.zpt zpt/folder/manage_add_MPIWGFolder.zpt zpt/folder/manage_change_weight.zpt zpt/folder/manage_config.zpt zpt/link/manage_add_MPIWGLink.zpt zpt/link/manage_change.zpt zpt/root/manage_add_MPIWGRoot.zpt zpt/root/manage_change.zpt zpt/staff/edit_additionalLinks.zpt zpt/staff/edit_basic.zpt zpt/staff/edit_downloads.zpt zpt/staff/edit_image.zpt zpt/staff/edit_main.zpt zpt/staff/edit_profile.zpt zpt/staff/edit_publications.zpt zpt/staff/edit_shortEntry.zpt zpt/staff/edit_talks.zpt zpt/staff/edit_teaching.zpt zpt/staff/manage_add_MPIWGStaffFolder.zpt zpt/staff/old/addMPIWGStaffForm.zpt zpt/www/common_template.zpt
diffstat 33 files changed, 504 insertions(+), 509 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGFolder.py	Thu Jun 06 14:00:31 2013 +0200
+++ b/MPIWGFolder.py	Thu Jun 06 15:34:20 2013 +0200
@@ -1,8 +1,8 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 import logging
 from OFS.Folder import Folder
-from AccessControl import ClassSecurityInfo
-from MPIWGHelper import *
+
+import MPIWGHelper
 
 
 class MPIWGFolder(Folder):
@@ -16,8 +16,8 @@
         {'label':'Configure', 'action':'changeForm'},
         )
 
-    changeWeightForm = PageTemplateFile('zpt/MPIWGFolderChangeWeight', globals())
-    changeForm = PageTemplateFile('zpt/MPIWGFolderConfig', globals())
+    changeWeightForm = PageTemplateFile('zpt/folder/manage_change_weight', globals())
+    changeForm = PageTemplateFile('zpt/folder/manage_config', globals())
     changeWeightsForm = PageTemplateFile('zpt/folder/manage_change_weights', globals())
 
     def __init__(self, id, title=None, weight=0, canonicalName=None):
@@ -74,16 +74,16 @@
         if RESPONSE is not None:
             RESPONSE.redirect('manage_main')
        
-    getBreadcrumbs = getBreadcrumbs
+    getBreadcrumbs = MPIWGHelper.getBreadcrumbs
     
-    getSection = getSection
+    getSection = MPIWGHelper.getSection
 
-    getSubSection = getSubSection
+    getSubSection = MPIWGHelper.getSubSection
     
 
 def manage_addMPIWGFolderForm(self):
     """Form for adding"""
-    pt = PageTemplateFile('zpt/AddMPIWGFolder', globals()).__of__(self)
+    pt = PageTemplateFile('zpt/folder/manage_add_MPIWGFolder', globals()).__of__(self)
     return pt()
 
 def manage_addMPIWGFolder(self, id, title=None, weight=0, RESPONSE=None):
--- a/MPIWGHelper.py	Thu Jun 06 14:00:31 2013 +0200
+++ b/MPIWGHelper.py	Thu Jun 06 15:34:20 2013 +0200
@@ -16,7 +16,7 @@
     rc = ""
     for node in nodelist:
         if node.nodeType == node.TEXT_NODE:
-           rc = rc + node.data
+            rc = rc + node.data
     return rc
 
 def getTemplate(self, tpName):
--- a/MPIWGLink.py	Thu Jun 06 14:00:31 2013 +0200
+++ b/MPIWGLink.py	Thu Jun 06 15:34:20 2013 +0200
@@ -1,40 +1,47 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
-from Products.PageTemplates.PageTemplate import PageTemplate
-from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
-from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder
-from Products.ZCatalog.CatalogPathAwareness import CatalogAware
-from OFS.Image import Image
-from Globals import package_home
-import urllib
-import MPIWGStaff
-import string
-import re
-import os
-from types import *
-import logging
-import xmlhelper # Methoden zur Verwaltung der projekt xml
 from OFS.SimpleItem import SimpleItem
-from OFS.Folder import Folder
-from Products.ZSQLMethods.SQL import SQLConnectionIDs
-from AccessControl import ClassSecurityInfo
-from bibliography import *
-import time
-import xml.dom.minidom
-import sys
-from Ft.Xml.XPath import Evaluate
-from Ft.Xml.XPath.Context import Context
-from Ft.Xml.Domlette import NonvalidatingReader,PrettyPrint, Print
-from Ft.Xml import EMPTY_NAMESPACE
-import copy
-import updatePersonalWWW
-import MPIWGStaff
 
-from MPIWGHelper import *
+import MPIWGHelper
+
 class MPIWGLink(SimpleItem):
     """create a symbolic link to another page"""
 
     meta_type="MPIWGLink"
     
+    manage_options=(
+        {'label':'main config','action':'changeLinkForm'},
+        )+SimpleItem.manage_options
+
+    changeLinkForm = PageTemplateFile('zpt/link/manage_change', globals())
+
+
+    def __init__(self,id,link,title='',weight=''):
+        """init mpiwglink"""
+        self.id=id
+        self.link=link
+        self.title=title
+        self.weight=weight
+
+
+    def getObj(self):
+        """bekomme original"""
+        splitted=self.link.lstrip().split("/")
+        obj=self
+        for x in splitted:
+            if not x=="":
+                obj=getattr(obj,x)
+            
+        return obj
+
+
+    def index_html(self,**argv):
+        """index"""
+        try:
+            return self.getObj().pt_render(extra_context={'here':self})
+        except:
+            self.REQUEST.RESPONSE.redirect(self.getObj().absolute_url())
+                                       
+
     def isActiveItem(self):
         """teste ob ausgewaehlt"""
         #url1 beim link anstelle von url1, da link jeweils index_html als url hat.
@@ -43,47 +50,12 @@
         else:
             return ""
 
-    def __init__(self,id,link,title='',weight=''):
-        """init mpiwglink"""
-        self.id=id
-        self.link=link
-        self.title=title
-        self.weight=weight
-
-    def getObj(self):
-        """bekomme original"""
-       ##  objpath=self.link.replace("/",".")
-##         if objpath[0]!=".":
-##             objpath="."+objpath
-
-##         print objpath
-##         return eval("self"+objpath)
-
-
-        splitted=self.link.lstrip().split("/")
-        obj=self
-        for x in splitted:
-            if not x=="":
-              obj=getattr(obj,x)
-            
-        return obj
-
     def getWeight(self):
         if self.linkWeight and self.linkWeight!="":
             return self.linkWeight
         else:
             return self.getObj().weight
 
-    manage_options=(
-        {'label':'main config','action':'changeLinkForm'},
-        )+SimpleItem.manage_options
-
-
-    def changeLinkForm(self):
-        """change MPIWG link"""
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGLinkChange.zpt')).__of__(self)
-        return pt()
-
     def changeLink(self,link,title,weight,RESPONSE=None):
         """change links"""
         self.link=link
@@ -93,21 +65,11 @@
         if RESPONSE is not None:
             RESPONSE.redirect('manage')
 
-    def index_html(self,**argv):
-        """index"""
-
-
-
-        try:
-            return self.getObj().pt_render(extra_context={'here':self})
-        except:
-            self.REQUEST.RESPONSE.redirect(self.getObj().absolute_url())
-                                       
 
 
 def manage_addMPIWGLinkForm(self):
     """Form for adding link"""
-    pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/AddMPIWGLink.zpt')).__of__(self)
+    pt=PageTemplateFile('zpt/link/manage_add_MPIWGLink.zpt', globals()).__of__(self)
     return pt()
 
 def manage_addMPIWGLink(self,id,link,title,weight,RESPONSE=None):
--- a/MPIWGRoot.py	Thu Jun 06 14:00:31 2013 +0200
+++ b/MPIWGRoot.py	Thu Jun 06 15:34:20 2013 +0200
@@ -50,6 +50,9 @@
     mpiwg_js = ImageFile('js/mpiwg.js', globals())
     # make mpiwg_js refreshable for development
     mpiwg_js.index_html = refreshingImageFileIndexHtml
+    # ZMI
+    changeMPIWGRootForm = PageTemplateFile('zpt/root/manage_change')
+
 
 
     def __init__(self, id, title):
@@ -250,11 +253,6 @@
         return unicodify(s)
     
 
-    def changeMPIWGRootForm(self):
-        """edit"""
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changeMPIWGRootForm')).__of__(self)
-        return pt()
-
     def changeMPIWGRoot(self,title,connection_id,coneServiceURL,lang=None,autocommit=None,RESPONSE=None):
         """change"""
         self.title=title
@@ -544,7 +542,7 @@
 
 def manage_addMPIWGRootForm(self):
     """form for adding the root"""
-    pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','addMPIWGRootForm.zpt')).__of__(self)
+    pt=PageTemplateFile('zpt/root/addMPIWGRootForm', globals()).__of__(self)
     return pt()
 
 def manage_addMPIWGRoot(self,id,title,connection_id="",RESPONSE=None):
--- a/MPIWGStaff.py	Thu Jun 06 14:00:31 2013 +0200
+++ b/MPIWGStaff.py	Thu Jun 06 15:34:20 2013 +0200
@@ -7,11 +7,9 @@
 
 from AccessControl import ClassSecurityInfo
 from App.class_init import InitializeClass
-from Products.ExtFile.ExtFile import * 
-from Globals import package_home
+from App.ImageFile import ImageFile
 from Products.PythonScripts.standard import sql_quote
 from Products.ExtFile import ExtFile
-import os
 import logging
 import email
 import re
@@ -47,6 +45,7 @@
     # templates
     #
     member_index_html = PageTemplateFile('zpt/staff/member_index_html', globals())
+    edit_css = ImageFile('css/edit.css', globals())
 
 
     #
@@ -310,10 +309,16 @@
             return res.coneid
         return None
     
-    def getPublishedImageUrl(self):
+    def getPublishedImageUrl(self, width=None, height=None, showAlways=False):
         """returns the URL to the image if it is published"""
-        if self.content.image_p == 'yes':
+        if self.content.image_p == 'yes' or showAlways:
             url = 'http://digilib.mpiwg-berlin.mpg.de/digitallibrary/Scaler?fn=permanent/mpiwg/staff/%s'%self.getUsername()
+            if width is not None:
+                url += '&dw=%s'%width
+                
+            if height is not None:
+                url += '&dh=%s'%height
+                
             return url
         
         return None
@@ -407,12 +412,10 @@
         ob=self.folder._getOb("downloadableFiles")._getOb("%s_publications.pdf"%self.getUsername().encode('utf-8'))
         REQUEST.RESPONSE.redirect(ob.absolute_url())
 
-    def getAdditionalLinks(self):
-        
-        return self.folder.executeZSQL("SELECT oid,* FROM additionalLink  WHERE  key_main = %s",[self.content.key]) 
-        #return self.folder.ZSQLInlineSearch(_table='talks',key_main=self.content.key)
-  
-        #return self.folder.ZSQLInlineSearch(_table='talks',key_main=self.content.key)
+
+    def getAdditionalLinks(self):        
+        return self.folder.executeZSQL("SELECT oid,* FROM additionalLink  WHERE  key_main = %s ORDER BY priority",[self.content.key]) 
+
     
     def getPathStyle(self, path, selected, style=""):
         """returns a string with the given style + 'sel' if path == selected."""
@@ -436,16 +439,13 @@
                 self.invalidate_cache()
                 self.changeData(argv);
                        
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_basic.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_basic', globals()).__of__(self)
         return pt()
         
    
-    security.declareProtected('View management screens','edit')    
+    security.declareProtected('View management screens','editShortEntry')    
     def editShortEntry(self,REQUEST=None):
         """Edit the  basic information"""
-      
-
-        
         if REQUEST:
             argv=REQUEST.form
             
@@ -453,47 +453,41 @@
                 self.invalidate_cache()
                 self.changeData(argv);
                        
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_shortEntry.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_shortEntry', globals()).__of__(self)
         return pt()
   
    
-    security.declareProtected('View management screens','editProfile')        
+    security.declareProtected('View management screens', 'editProfile')        
     def editProfile(self, REQUEST=None):
-         """edit Profile, new entry replaces CD, current work and research interests"""
-        
-         
-         if REQUEST:
-             kupu=REQUEST.form.get('kupu',None);
-             preview=REQUEST.form.get('preview',None);
+        """edit Profile, new entry replaces CD, current work and research interests"""
+        if REQUEST:
+            kupu = REQUEST.form.get('kupu', None);
+            preview = REQUEST.form.get('preview', None);
        
-         
-         if kupu:
-             start=kupu.find("<body>")
-             end=kupu.find("</body>")
+        if kupu:
+            start = kupu.find("<body>")
+            end = kupu.find("</body>")
          
-             newcontent= kupu[start+6:end]
-             query="UPDATE personal_www SET profile=%s WHERE key='%s'"       
-             self.executeZSQL(query%(self.ZSQLQuote(newcontent),self.content.key))
-             logging.error("PROFILE:"+query%(self.ZSQLQuote(newcontent),self.content.key))
+            newcontent = kupu[start + 6:end]
+            query = "UPDATE personal_www SET profile=%s WHERE key='%s'"       
+            self.executeZSQL(query % (self.ZSQLQuote(newcontent), self.content.key))
+            logging.error("PROFILE:" + query % (self.ZSQLQuote(newcontent), self.content.key))
         
-         if preview: 
-             pass
-                #TODO: not supported yet
-                #if RESPONSE:
-                #    self.redirect(RESPONSE,"editProfile")
-                
-                #return self.preview(newcontent)
+        if preview: 
+            pass
+            # TODO: not supported yet
+            # if RESPONSE:
+            #    self.redirect(RESPONSE,"editProfile")
+            # return self.preview(newcontent)
           
-         pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_profile.zpt')).__of__(self)
-         return pt()
+        pt = PageTemplateFile('zpt/staff/edit_profile.zpt', globals()).__of__(self)
+        return pt()
         
     
 
     security.declareProtected('View management screens','editTalks')    
     def editTalks(self,REQUEST):
         """edit talks"""
-
-
         if REQUEST:
             argv=REQUEST.form
             
@@ -501,15 +495,13 @@
                 self.invalidate_cache()
                 self.changeAdditionalData(argv);
                        
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_talks.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_talks.zpt', globals()).__of__(self)
         return pt()
      
    
     security.declareProtected('View management screens','editTeaching')    
     def editTeaching(self,REQUEST):
         """edit teaching"""
-
-
         if REQUEST:
             argv=REQUEST.form
             
@@ -517,14 +509,13 @@
                 self.invalidate_cache()
                 self.changeAdditionalData(argv);
                        
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_teaching.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_teaching.zpt', globals()).__of__(self)
         return pt()
      
    
-    security.declareProtected('View management screens','editAdditionalLinks.zpt')
+    security.declareProtected('View management screens','editAdditionalLinks')
     def editAdditionalLinks(self,REQUEST):    
-        """editiere die additiona link von der Webseite"""
-        
+        """editiere die additional link von der Webseite"""
         if REQUEST:
             argv=REQUEST.form
             
@@ -532,7 +523,7 @@
                 self.invalidate_cache()
                 self.changeAdditionalData(argv);
                        
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_additionalLinks.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_additionalLinks.zpt', globals()).__of__(self)
         return pt()
     
     
@@ -540,13 +531,11 @@
     def editDownloads(self,REQUEST):    
         """editiere die Downloads von der Webseite"""
         
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_downloads.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_downloads.zpt', globals()).__of__(self)
         return pt()
    
     def editPublications(self,REQUEST):    
         """editiere die Publications von der Webseite"""
-        
-        
         data=REQUEST.form
         
         if data.has_key('selectionMode'):
@@ -556,12 +545,25 @@
             
             self.refresh_content()
             
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff','edit_publications.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/staff/edit_publications.zpt', globals()).__of__(self)
         return pt()
    
 
+    security.declareProtected('View management screens','editImage')    
+    def editImage(self,REQUEST=None):
+        """Edit the image information"""
+        if REQUEST:
+            argv=REQUEST.form
+            
+            if argv.has_key('image_p'): #got data to change
+                self.invalidate_cache()
+                self.changeData(argv);
+                       
+        pt=PageTemplateFile('zpt/staff/edit_image', globals()).__of__(self)
+        return pt()
+  
+
     def refresh_content(self,):
-        
         self.content = self.folder.executeZSQL("select * from personal_www where key = %s", [self.getKey()])[0]
         
         
@@ -586,29 +588,20 @@
             cvName=cvName.encode('utf-8')
             logging.debug("CCC")
             if not hasattr(ob,cvName):
-                
                 cvFile = ExtFile(cvName,cvName)
                 ob._setObject(cvName,cvFile)
-            
           
             cvFile = getattr(ob,cvName)
                 
             cvFile.manage_upload(file=data['cv_pdf'])
-            
-           
-            
         
         if data.get('publications_pdf',None):
-            
-            
             pdfName="%s_publications.pdf"%self.getUsername()
             pdfName=pdfName.encode('utf-8')
             
             if not hasattr(ob,pdfName):
-                
                 cvFile = ExtFile(pdfName,pdfName)
                 ob._setObject(pdfName,cvFile)
-            
          
             cvFile = getattr(ob,pdfName)
                 
@@ -616,21 +609,18 @@
             
       
         #REQUEST.response.redirect(self.REQUEST['HTTP_REFERER'])
- 
-   
     
 
     def changeData(self,changeSet):
         """changes the data in the database, changeset expects field --> value."""
         for field in changeSet.keys():
-            if hasattr(self.content,field):
+            if hasattr(self.content, field):
                 logging.debug("Changing: %s"%field)
-                
-                
-                results = self.folder.executeZSQL("update personal_www set "+field+" = %s where key = %s ", [changeSet.get(field),self.getKey().encode('utf-8')]);
-        
+                results = self.folder.executeZSQL("update personal_www set "+field+" = %s where key = %s", [changeSet.get(field),self.getKey().encode('utf-8')]);
                 logging.debug(results)
    
+        self.refresh_content()
+   
    
     security.declareProtected('View management screens','changeAdditionalData')
     def changeAdditionalData(self,data):
@@ -767,7 +757,7 @@
         data=REQUEST.form
        
         if data.get("method",None) is None:
-            pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','add_publications.zpt')).__of__(self)
+            pt=PageTemplateFile('zpt/staff/pubman/add_publications.zpt', globals()).__of__(self)
             return pt()
         
         
@@ -777,7 +767,7 @@
     
             
             entries= self.mpiwgPubman.search(data,contexts=["escidoc:85274","escidoc:38279"])
-            pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','add_publications.zpt')).__of__(self)
+            pt=PageTemplateFile('zpt/staff/pubman/add_publications.zpt', globals()).__of__(self)
             
            
             return pt(values=entries)
@@ -834,7 +824,7 @@
                     self.setPublicationPriority(splitted[0],value);
                     
         
-        pt = PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','change_publications.zpt')).__of__(self) 
+        pt = PageTemplateFile('zpt/staff/pubman/change_publications', globals()).__of__(self) 
         return pt()
     
     
--- a/zpt/AddMPIWGFolder.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<html>
-<body>
-<h2>Generate Folder for MPIWGWeb</h2>
-
-
-
-<form method="post" action="manage_addMPIWGFolder">
-<table>
-<tr>
-	<td><b>ID</b></td>
-	<td><input type="text" size="40" name="id"></td>
-</tr>
-<tr>
-	<td><i>Title</i></td>
-	<td><input type="text" size="40" name="title"></td>
-</tr>
-<tr>
-	<td><i>Weight</i></td>
-	<td><input type="text" size="40" name="weight"></td>
-</tr>
-
-</table>
-
-<input type="submit" value="create">
-
-</form>
-</body>
-</html>
--- a/zpt/AddMPIWGLink.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<html>
-<body>
-<h2>Change MPIWG Link</h2>
-<form action="manage_addMPIWGLink" method="post">
-<p>Id:<input name="id" size="30"></p>
-<p>Title:<input name="title" size="100"></p>
-<p>Link:<input name="link" size="100"></p>
-<p>Weight:<input name="weight"  size="100"></p>
-<p><input type="submit" value="submit"></p>
-</form>
-</body>
-</html>
--- a/zpt/MPIWGFolderConfig.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<html>
-<h2>Change MPIWG Folder</h2>
-<form action="changeMPIWGFolder" method="pro">
-Title: <input tal:attributes="value here/title|nothing" name="title"><br>
-Weight: <input tal:attributes="value here/weight|string:0" name="weight"><br>
-CanonicalName: <input tal:attributes="value here/canonicalName|nothing" name="canonicalName"><br>
-<input type="submit">
-</form>
-</html>
--- a/zpt/MPIWGLinkChange.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<html>
-<body>
-<h2>Change MPIWG Link</h2>
-<form action="changeLink" method="post">
-<p>Title:<input name="title" tal:attributes="value here/title" size="100"></p>
-<p>Link:<input name="link" tal:attributes="value here/link" size="100"></p>
-<p>Weight:<input name="weight" tal:attributes="value here/weight" size="100"></p>
-<p><input type="submit"></p>
-</form>
-</body>
-</html>
--- a/zpt/addMPIWGRootForm.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<html>
-<head>
-   <title>The title</title>
-</head>
-<body>
-
-<div>
-
-<h1>Project-Upload</h1>
-<form method="post" action="manage_addMPIWGRoot">
-<p>ID:</p>
-<input name="id">
-<p>Title:</p>
-<input name="title"/>
-<p>Discipline list (seperated by CR)
-<textarea name="disciplineList" cols=50 rows=20></textarea>
-</p>
-<p>Themes List (seperated by CR)
-<textarea name="themesList" cols=50 rows=20></textarea>
-</p>
-<!--<div class="form-element">
-    
-    <select name="connection_id">
-     
-     <tal:block tal:repeat="id python:here.SQLConnectionIDs()">
-                <option  tal:condition="python:getattr(here,'connection_id','')==id"  tal:attributes="value id" selected tal:content="id"/>
-                <option  tal:condition="not:python:getattr(here,'connection_id','')==id"  tal:attributes="value id" tal:content="id"/>
-            </tal:block>
-    </select>
-</div>-->
-<input type="submit">
-</form>
-</div>
-</body>
-</html>
--- a/zpt/addMPIWGStaffFolderForm.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-  <div tal:replace="structure here/manage_page_header">Header</div>
-  <h2>Add a MPIWGStaff folder</h2>
-  <form method="post" action="manage_addMPIWGStaffFolder">
-    <p class="form-label">ID</p>
-        <p class="form-element"><input size="80" name="id"/></p>
-    <p class="form-label">Title</p>
-        <p class="form-element"><input size="80" name="title"/></p>
-     <p><input type="submit" value="Add" /></p>
-  </form>
--- a/zpt/addMPIWGStaffForm.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-<html>
-<head>
-   <title>The title</title>
-</head>
-<body>
-
-<div>
-
-<h1>Add a staff member</h1>
-<form method="post" action="manage_addMPIWGStaff">
-<p>ID = emailname
-<input name="id"></p>
-<p>LastName:
-<input name="lastName"/></p>
-<p>FirstName:
-<input name="firstName"/></p>
-
-<input type="submit">
-</form>
-</div>
-</body>
-</html>
--- a/zpt/changeMPIWGRootForm.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<html>
-<head>
-   <title>The title</title>
-</head>
-<body>
-
-<div>
-
-<h1>Change MPIWGRoot</h1>
-<form method="post" action="changeMPIWGRoot">
-
-<p>Title:<br/>
-<input tal:attributes="value python:getattr(here,'title','')" name="title"/>
-</p>
-<p>Default language:<br/>
-<input tal:attributes="value python:getattr(here,'lang','en')" name="lang"/>
-</p>
-
-<p>Cone Service URL:<br/>
-<input size="100" tal:attributes="value python:getattr(here,'coneServiceURL','http://virtuoso.mpiwg-berlin.mpg.de:8080/MetaDataManagerRestlet/cone/')" name="coneServiceURL"/>
-</p>
-
-<p>
-<div class="form-element">
-    
-    <select name="connection_id">
-     
-     <tal:block tal:repeat="id python:here.SQLConnectionIDs()[0]">
-                <option  tal:condition="python:getattr(here,'connection_id','')==id"  tal:attributes="value id" selected tal:content="id"/>
-                <option  tal:condition="not:python:getattr(here,'connection_id','')==id"  tal:attributes="value id" tal:content="id"/>
-            </tal:block>
-    </select>
-    </div>
-
-    <p class="form-label">Autocommit</p>
-    <p>
-      <input type="checkbox" name="autocommit" tal:attributes="checked here/autocommit | nothing"/> autocommit (don't use when you want transactions)
-    </p>
-<input type="submit">
-</form>
-</div>
-</body>
-</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/folder/manage_add_MPIWGFolder.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,28 @@
+<html>
+<body>
+<h2>Generate Folder for MPIWGWeb</h2>
+
+
+
+<form method="post" action="manage_addMPIWGFolder">
+<table>
+<tr>
+	<td><b>ID</b></td>
+	<td><input type="text" size="40" name="id"></td>
+</tr>
+<tr>
+	<td><i>Title</i></td>
+	<td><input type="text" size="40" name="title"></td>
+</tr>
+<tr>
+	<td><i>Weight</i></td>
+	<td><input type="text" size="40" name="weight"></td>
+</tr>
+
+</table>
+
+<input type="submit" value="create">
+
+</form>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/folder/manage_change_weight.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,7 @@
+<html>
+<h2>Change Weight</h2>
+<form action="changeWeight" method="pro">
+<input tal:attributes="value here/weight|string:0" name="weight"><br>
+<input type="submit">
+</form>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/folder/manage_config.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,9 @@
+<html>
+<h2>Change MPIWG Folder</h2>
+<form action="changeMPIWGFolder" method="pro">
+Title: <input tal:attributes="value here/title|nothing" name="title"><br>
+Weight: <input tal:attributes="value here/weight|string:0" name="weight"><br>
+CanonicalName: <input tal:attributes="value here/canonicalName|nothing" name="canonicalName"><br>
+<input type="submit">
+</form>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/link/manage_add_MPIWGLink.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,12 @@
+<html>
+<body>
+<h2>Change MPIWG Link</h2>
+<form action="manage_addMPIWGLink" method="post">
+<p>Id:<input name="id" size="30"></p>
+<p>Title:<input name="title" size="100"></p>
+<p>Link:<input name="link" size="100"></p>
+<p>Weight:<input name="weight"  size="100"></p>
+<p><input type="submit" value="submit"></p>
+</form>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/link/manage_change.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,11 @@
+<html>
+<body>
+<h2>Change MPIWG Link</h2>
+<form action="changeLink" method="post">
+<p>Title:<input name="title" tal:attributes="value here/title" size="100"></p>
+<p>Link:<input name="link" tal:attributes="value here/link" size="100"></p>
+<p>Weight:<input name="weight" tal:attributes="value here/weight" size="100"></p>
+<p><input type="submit"></p>
+</form>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/root/manage_add_MPIWGRoot.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,35 @@
+<html>
+<head>
+   <title>The title</title>
+</head>
+<body>
+
+<div>
+
+<h1>Project-Upload</h1>
+<form method="post" action="manage_addMPIWGRoot">
+<p>ID:</p>
+<input name="id">
+<p>Title:</p>
+<input name="title"/>
+<p>Discipline list (seperated by CR)
+<textarea name="disciplineList" cols=50 rows=20></textarea>
+</p>
+<p>Themes List (seperated by CR)
+<textarea name="themesList" cols=50 rows=20></textarea>
+</p>
+<!--<div class="form-element">
+    
+    <select name="connection_id">
+     
+     <tal:block tal:repeat="id python:here.SQLConnectionIDs()">
+                <option  tal:condition="python:getattr(here,'connection_id','')==id"  tal:attributes="value id" selected tal:content="id"/>
+                <option  tal:condition="not:python:getattr(here,'connection_id','')==id"  tal:attributes="value id" tal:content="id"/>
+            </tal:block>
+    </select>
+</div>-->
+<input type="submit">
+</form>
+</div>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/root/manage_change.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,43 @@
+<html>
+<head>
+   <title>The title</title>
+</head>
+<body>
+
+<div>
+
+<h1>Change MPIWGRoot</h1>
+<form method="post" action="changeMPIWGRoot">
+
+<p>Title:<br/>
+<input tal:attributes="value python:getattr(here,'title','')" name="title"/>
+</p>
+<p>Default language:<br/>
+<input tal:attributes="value python:getattr(here,'lang','en')" name="lang"/>
+</p>
+
+<p>Cone Service URL:<br/>
+<input size="100" tal:attributes="value python:getattr(here,'coneServiceURL','http://virtuoso.mpiwg-berlin.mpg.de:8080/MetaDataManagerRestlet/cone/')" name="coneServiceURL"/>
+</p>
+
+<p>
+<div class="form-element">
+    
+    <select name="connection_id">
+     
+     <tal:block tal:repeat="id python:here.SQLConnectionIDs()[0]">
+                <option  tal:condition="python:getattr(here,'connection_id','')==id"  tal:attributes="value id" selected tal:content="id"/>
+                <option  tal:condition="not:python:getattr(here,'connection_id','')==id"  tal:attributes="value id" tal:content="id"/>
+            </tal:block>
+    </select>
+    </div>
+
+    <p class="form-label">Autocommit</p>
+    <p>
+      <input type="checkbox" name="autocommit" tal:attributes="checked here/autocommit | nothing"/> autocommit (don't use when you want transactions)
+    </p>
+<input type="submit">
+</form>
+</div>
+</body>
+</html>
--- a/zpt/staff/edit_additionalLinks.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_additionalLinks.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -9,30 +9,28 @@
 <tal:block metal:fill-slot="body" tal:define="yes_no_list python:'yes\nno'">
   <form action="" method="post">
   <input type="hidden" name="main_fields" value="additionalLink__title">
-  <table tal:define="founds2 python:here.getAdditionalLinks()">
-   <tal:x tal:repeat="found2 python:here.sortPriority(founds2)">
+  <table tal:define="links python:here.getAdditionalLinks()">
+   <tal:x tal:repeat="link links">
     <tr class="fliesstext">
       <td>Text over Link</td>
-      <td><input tal:attributes="name python:'additionalLink__title__'+str(found2.oid); 
-				     value python:found2.title" size="80" /> </td>
+      <td><input tal:attributes="name python:'additionalLink__title__'+str(link.oid); 
+				     value python:link.title" size="80" /> </td>
 	</tr>
 	<tr>
 		<td>Url</td>
-     	<td><input tal:attributes="name python:'additionalLink__link__'+str(found2.oid); 
-				     value python:found2.link" size="80" /></td>
+     	<td><input tal:attributes="name python:'additionalLink__link__'+str(link.oid); 
+				     value python:link.link" size="80" /></td>
 	</tr>
 	<tr>
-      <td valign="top">Priority <input tal:attributes="name python:'additionalLink__priority__'+str(found2.oid);
-				     value python:found2.priority"
+      <td valign="top">Priority <input tal:attributes="name python:'additionalLink__priority__'+str(link.oid);
+				     value python:link.priority"
         size="3" />
       </td>
       <td valign="top">Publish 
-        <tal:x tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'additionalLink__published__'+str(found2.oid),
-			     yes_no_list,
-			     boxType='radio',
-			     checked=found2.published)" />
-      &nbsp;&nbsp;<a tal:attributes="href python:'deleteField?table=additionalLink&oid=%s'%found2.oid">delete this link</a>
+        <span tal:define="name string:additionalLink__published__${link/oid}; value link/published;">
+          <tal:block metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </span>
+      &nbsp;&nbsp;<a tal:attributes="href python:'deleteField?table=additionalLink&oid=%s'%link.oid">delete this link</a>
       </td>
     </tr>
     <tr>
@@ -53,12 +51,10 @@
     <tr>
       <td>Priority <input tal:attributes="name python:'additionalLink__priority__new'" size="3"></td>
       <td valign="top">Publish
-        <tal:x tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'additionalLink__published__new',
-			     yes_no_list,
-			     boxType='radio',
-			     checked='yes')" />
-			     </td>
+        <span tal:define="name string:additionalLink__published__new; value string:yes;">
+          <tal:block metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </span>
+     </td>
     </tr>
   </table>
   <input type="submit" value="submit">
--- a/zpt/staff/edit_basic.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_basic.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -8,62 +8,58 @@
   <table>
   	<tr>
   		<td><b>Name</b></td>
-  		<td><input size="30" tal:attributes="value python:here.content.last_name" name="last_name"></td>
+  		<td><input size="30" tal:attributes="value here/content/last_name" name="last_name"></td>
   	</tr>
   	<tr>
   		<td><b>First Name</b></td>
-  		<td><input size="30" tal:attributes="value python:here.content.first_name" name="first_name"></td>
+  		<td><input size="30" tal:attributes="value here/content/first_name" name="first_name"></td>
   	</tr>
   	<tr>
   	 	<td><b>Academic degrees and position</b></td>
-  		<td><textarea  tal:content="python:here.content.titles_new" name="titles_new" cols="60" rows="3"/></td>
+  		<td><textarea  tal:content="here/content/titles_new" name="titles_new" cols="60" rows="1"/></td>
   	</tr>
   	<tr>
   		<td><b>Status</b></td>
-  		<td tal:content="python:here.content.status"/>
+  		<td tal:content="here/content/status"/>
   	</tr>
   	<tr>
   		<td><b>Department</b></td>
-  		<td tal:content="python:here.content.department"/>
+  		<td tal:content="here/content/department"/>
   	</tr>
   	<tr>
   		<td><b>Stay</b></td>
-  		<td><span tal:content="python:here.content.date_from"/> to
-  		  <span tal:content="python:here.content.date_to"/>
+  		<td><span tal:content="here/content/date_from"/> to
+  		  <span tal:content="here/content/date_to"/>
   		</td>
   	<tr>
   		<td><b>Funded by (external funding)</b></td>
-  		<td><input size="30" tal:attributes="value python:here.content.funded_by" name="funded_by"></td>
+  		<td><input size="30" tal:attributes="value here/content/funded_by" name="funded_by"></td>
   	</tr>
   	
 <!--  	<tr>
   	 	<td><b>Home institution</b></td>
-  		<td><input size="30" tal:attributes="value python:here.content.home_inst" name="home_inst"></td>
+  		<td><input size="30" tal:attributes="value here/content/home_inst" name="home_inst"></td>
   	</tr>-->
  </table>
  <table>
     <tr><th></th><th></th><th align="left">show</th></tr>
  	<tr>
  		<td><b>email (MPIWG)</b></td>
- 		<td tal:content="python:here.content.e_mail"/>
- 		<td valign="top" tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'e_mail_p',
-			     yes_no_list,
-			     boxType='radio',
-			     checked=here.content.e_mail_p)"/>
- 	</tr>
+ 		<td tal:content="here/content/e_mail"/>
+ 		<td valign="top" tal:define="name string:e_mail_p; value here/content/e_mail_p;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </td>
+	</tr>
  	<tr>
  		<td><b>email (additional)</b></td>
- 		<td><input size="30" name="e_mail2" tal:attributes="value python:here.content.e_mail2"></td>
- 		<td valign="top" tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'e_mail2_p',
-			     yes_no_list,
-			     boxType='radio',
-			     checked=here.content.e_mail2_p)"/>
+ 		<td><input size="30" name="e_mail2" tal:attributes="value here/content/e_mail2"></td>
+        <td valign="top" tal:define="name string:e_mail2_p; value here/content/e_mail2_p;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </td>
  	</tr>
  	<tr>
  		<td><b>Room</b></td>
- 		<td><input size="30" name="room_no" tal:attributes="value python:here.content.room_no"></td>
+ 		<td><input size="30" name="room_no" tal:attributes="value here/content/room_no"></td>
  		<td>(never published)</td>
  	</tr>
  	
@@ -75,21 +71,17 @@
  -->	
  	<tr>
  		<td><b>Telephone</b></td>
- 		<td><input size="30" name="telefon" tal:attributes="value python:here.content.telefon"></td>
- 		<td valign="top" tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'telefon_p',
-			     yes_no_list,
-			     boxType='radio',
-			     checked=here.content.telefon_p)"/>
+ 		<td><input size="30" name="telefon" tal:attributes="value here/content/telefon"></td>
+        <td valign="top" tal:define="name string:telefon_p; value here/content/telefon_p;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </td>
  	</tr>
  	<tr>
  		<td><b>Fax</b></td>
- 		<td><input size="30" name="fax" tal:attributes="value python:here.content.fax"></td>
- 		<td valign="top" tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'fax_p',
-			     yes_no_list,
-			     boxType='radio',
-			     checked=here.content.fax_p)"/>
+ 		<td><input size="30" name="fax" tal:attributes="value here/content/fax"></td>
+        <td valign="top" tal:define="name string:fax_p; value here/content/fax_p;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </td>
  	</tr>
  </table>
  <input type="submit" value="submit">
--- a/zpt/staff/edit_downloads.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_downloads.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -4,53 +4,79 @@
 <head>
 </head>
 <body>
-<tal:block metal:fill-slot="navsel" tal:define="global menusel string:downloads" />
-<tal:block metal:fill-slot="body" tal:define="yes_no_list python:'yes\nno'">
-<p>Here you can upload your CV and and publication list to be downloaded from your homepage.</p>
-<p>The documents should be in <b>PDF format</b>. Add the add bottom of this page you find <a href="#templates">templates</a> for OpenOffice and
-Word to make it easier for you to create these documents.</p>
-<form action="changeDownloads" method="post" enctype="multipart/form-data">
-<h2>Your CV</h2>
-<p><input type="hidden" name="key" tal:attributes="value here/getKey"/></p>
-<p><input type="file" name="cv_pdf"/></p>
-<p>Remember that documents should be in <b>PDF format</b>. <br/><input type="submit" value="Upload the file"/></p>
-<p><a href="downloadCV">Download the CV currently stored at the server.</a> (last update:<span tal:content="here/getLastUpdateCV"/>)</p>
-<p>publish: <tal:x tal:content="structure python:here.ZSQLSelectionFromCRList(
-           'cv_publish',
-           yes_no_list,
-           boxType='radio',
-           checked=getattr(here,'cv_publish','no'))" /></p>
+  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:downloads" />
+  <tal:block metal:fill-slot="body">
+    <p>Here you can upload your CV and and publication list to be downloaded from your homepage.</p>
+    <p>
+      The documents should be in <b>PDF format</b>. Add the add bottom of this page you find <a href="#templates">templates</a> for
+      OpenOffice and Word to make it easier for you to create these documents.
+    </p>
+    <form action="changeDownloads" method="post" enctype="multipart/form-data">
+      <h2>Your CV</h2>
+      <p>
+        <input type="hidden" name="key" tal:attributes="value here/getKey" />
+      </p>
+      <p>
+        <input type="file" name="cv_pdf" />
+      </p>
+      <p>
+        Remember that documents should be in <b>PDF format</b>. <br />
+        <input type="submit" value="Upload the file" />
+      </p>
+      <p>
+        <a href="downloadCV">Download the CV currently stored at the server.</a> (last update:<span
+          tal:content="here/getLastUpdateCV" />)
+      </p>
+      <p>
+        publish:
+        <span tal:define="name string:cv_publish; value here/content/cv_p | nothing;">
+          <tal:block metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </span>
+      </p>
 
-<h2>Publication list</h2>
-<p><input type="file" name="publications_pdf"/></p>
-<p>Remember that documents should be in <b>PDF format</b>. <br/><input type="submit" value="Upload the file"/></p>
-<p><a href="downloadPublications">Download the publicaton list currently stored at the server. </a>(last update:<span tal:content="here/getLastUpdatePublications"/>)</p>
-<p>publish: <tal:x tal:content="structure python:here.ZSQLSelectionFromCRList(
-           'publications_publish',
-           yes_no_list,
-           boxType='radio',
-           checked=getattr(here,'publications_publish','no'))" /></p>
-
-<p><input type="submit" value="Update"/></p>
+      <h2>Publication list</h2>
+      <p>
+        <input type="file" name="publications_pdf" />
+      </p>
+      <p>
+        Remember that documents should be in <b>PDF format</b>. <br />
+        <input type="submit" value="Upload the file" />
+      </p>
+      <p>
+        <a href="downloadPublications">Download the publication list currently stored at the server. </a>(last update:<span
+          tal:content="here/getLastUpdatePublications" />)
+      </p>
+      <p>
+        publish:
+        <span tal:define="name string:publications_publish; value here/content/publications_p | nothing;">
+          <tal:block metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+        </span>
+      </p>
 
-</form>
-<br/> <br/>
-<a name="templates"/><h3>Download Templates:</h3>
-<ul>
-  <li>For OpenOffice Writer:
+      <p>
+        <input type="submit" value="Update" />
+      </p>
+
+    </form>
+    <br />
+    <br />
+    <a name="templates" />
+    <h3>Download Templates:</h3>
     <ul>
-      <li><a href="downloads/publications_template.ott">Publication List</a> </li>
-	  <li><a href="downloads/CV_template.ott">CV</a></li>
-    </ul>	
-  </li>
-  <li>For Ms Word:
-    <ul>
-	 <li><a href="downloads/Vorlage_Publikation.dot">Publication List</a></li>
-	 <li><a href="downloads/Beispiel_CV.doc">CV</a></li>
+      <li>For OpenOffice Writer:
+        <ul>
+          <li><a href="downloads/publications_template.ott">Publication List</a></li>
+          <li><a href="downloads/CV_template.ott">CV</a></li>
+        </ul>
+      </li>
+      <li>For Ms Word:
+        <ul>
+          <li><a href="downloads/Vorlage_Publikation.dot">Publication List</a></li>
+          <li><a href="downloads/Beispiel_CV.doc">CV</a></li>
+        </ul>
+      </li>
     </ul>
-  </li>
-</ul>
-</tal:block>
+  </tal:block>
 
 </body>
 </html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/staff/edit_image.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html metal:use-macro="here/mainEditFile/macros/page">
+<body>
+  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:image" />
+
+  <tal:block metal:fill-slot="body">
+    <form tal:attributes="action string:$root/editImage" method="post">
+      <p>
+        <img tal:define="url python:here.getPublishedImageUrl(width=165, showAlways=True)" tal:condition="url" tal:attributes="src url" />
+      </p>
+      <p tal:define="name string:image_p; value here/content/image_p;">
+        Show this photo on the homepage:
+        <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+      </p>
+        <!-- 
+    <p>Filename:<input type="file" name="file" size="30"></p>
+    <p>Images should not be too big. Allowed formats: JPEG, TIFF or PNG. Files must have proper extension *.jpg, *.tif or *.png.</p>
+-->
+      <p>Please contact the IT-support (support@mpiwg-berlin.mpg.de) to upload a picture for you.</p>
+      <p>
+        <input type="submit" />
+      </p>
+    </form>
+
+  </tal:block>
+</body>
+</html>
\ No newline at end of file
--- a/zpt/staff/edit_main.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_main.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -1,35 +1,36 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html metal:define-macro="page">
+<html metal:define-macro="page"
+  tal:define="global onload nothing;
+              global menusel nothing;
+              global staffroot python:here.MPIWGrootURL()+'/members';
+              global root string:$staffroot/${here/getUsername};">
 <head>
-  <!--  <base tal:attributes="href python:here.getStaffURL()+'/'"/>-->
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <link rel="stylesheet" href="editstaff.css" type="text/css"/>  
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+  <link rel="stylesheet" tal:attributes="href string:$staffroot/edit_css" type="text/css"/>  
   <metal:x metal:define-slot="javascript"/>
 </head>
-<body onload="kupu = startKupu();">
-  <h2 class="title">Edit homepage of <span tal:replace="python:here.content.first_name"/> <span tal:replace="python:here.content.last_name"/></h2>
+<body tal:attributes="onload onload">
+  <h2 class="title">Edit homepage of <span tal:replace="here/content/first_name"/> <span tal:replace="here/content/last_name"/></h2>
   <metal:block metal:define-slot="navsel"/>
    <p>Please contact the support group <a href="mailto:support@mpiwg-berlin.mpg.de">support@mpiwg-berlin.mpg.de (Tel. 247)</a>, if you need any help.</p>
   
   <div class="mainnav">
-    <span tal:attributes="class python:here.getPathStyle('maindata', menusel, 'mainmenu')"><a href="edit">Basic Data</a></span>
-    <span tal:attributes="class python:here.getPathStyle('cv', menusel, 'mainmenu')"><a href="editProfile">Profile</a></span>
-    <span tal:attributes="class python:here.getPathStyle('publications', menusel, 'mainmenu')"><a href="editPublications">Publications</a></span>
-    <span tal:attributes="class python:here.getPathStyle('research', menusel, 'mainmenu')"><a href="editShortEntry">Research: short entry</a></span>
-    <span tal:attributes="class python:here.getPathStyle('image', menusel, 'mainmenu')"><a href="editImage">Photo</a></span>
-    <span tal:attributes="class python:here.getPathStyle('downloads', menusel, 'mainmenu')"><a href="editDownloads">Edit 
+    <span tal:attributes="class python:here.getPathStyle('maindata', menusel, 'mainmenu')"><a tal:attributes="href string:$root/edit">Basic Data</a></span>
+    <span tal:attributes="class python:here.getPathStyle('cv', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editProfile">Profile</a></span>
+    <span tal:attributes="class python:here.getPathStyle('publications', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editPublications">Publications</a></span>
+    <span tal:attributes="class python:here.getPathStyle('research', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editShortEntry">Research: short entry</a></span>
+    <span tal:attributes="class python:here.getPathStyle('image', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editImage">Photo</a></span>
+    <span tal:attributes="class python:here.getPathStyle('downloads', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editDownloads">Edit 
 downloads</a></span>
     <!--  <span tal:attributes="class python:here.getPathStyle('cv', menusel, 'mainmenu')"><a href="editCV">Curriculum Vitae</a></span>-->
     
     <!--  <span tal:attributes="class python:here.getPathStyle('awards', menusel, 'mainmenu')"><a href="editAwards">Awards</a></span>-->
-    <span tal:attributes="class python:here.getPathStyle('talks', menusel, 'mainmenu')"><a href="editTalks">Talks</a></span>
-    <span tal:attributes="class python:here.getPathStyle('teaching', menusel, 'mainmenu')"><a href="editTeaching">Teaching</a></span>
-    <span tal:attributes="class python:here.getPathStyle('additionalLink', menusel, 'mainmenu')"><a href="editAdditionalLinks">Additional links</a></span>
- 
+    <span tal:attributes="class python:here.getPathStyle('talks', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editTalks">Talks</a></span>
+    <span tal:attributes="class python:here.getPathStyle('teaching', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editTeaching">Teaching</a></span>
+    <span tal:attributes="class python:here.getPathStyle('additionalLink', menusel, 'mainmenu')"><a tal:attributes="href string:$root/editAdditionalLinks">Additional links</a></span>
     
-    
-    <span class="mainmenu"><a tal:attributes="href python:'http://www.mpiwg-berlin.mpg.de/en/staff/members/'+here.getStaffURL()+'/index_html'" target="_blank">View</a></span>
+    <span class="mainmenu"><a tal:attributes="href python:here.en.MPIWGrootURL()+'/staff/members/'+here.getUsername()" target="_blank">View</a></span>
   </div>
   <div class="content">
   <tal:block metal:define-slot="body"/>
--- a/zpt/staff/edit_profile.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_profile.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -1,7 +1,8 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html metal:use-macro="here/mainEditFile/macros/page">
-<metal:x metal:fill-slot="javascript">
+<metal:x metal:fill-slot="javascript"
+  tal:define="global onload string:kupu = startKupu();">
 <metal:macros xmlns:metal="http://xml.zope.org/namespaces/metal" use-macro="here/kupuEditor/kupumacros/macros/head">
   <metal:macros fill-slot="bootstrap-editor">
     <script type="text/javascript" src="/kupuEditor/kupuinit_form.js"> </script>
--- a/zpt/staff/edit_publications.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_publications.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -2,28 +2,25 @@
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html metal:use-macro="here/mainEditFile/macros/page">
 <body>
-  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:maindata"/>
-  <tal:block metal:fill-slot="body" tal:define="yes_no_list python:'yes\nno'">
- 
- 
- <h2>Selection mode</h2>
- <form method="post" action="">
- 
- 
- <input type="radio" name="selectionMode" value="year" tal:attributes="checked python:test(here.content.publications_mode=='year','true','')"/>
- Show the five most recent publications. (no further action needed)
- <input type="radio" name="selectionMode" value="priority" tal:attributes="checked python:test(here.content.publications_mode=='priority','true','')"/>Show selected publications.
- <input type="submit" name="submit"/>
- </form>
+  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:publications" />
+  <tal:block metal:fill-slot="body">
+
 
- 
- 
- <ul tal:condition="python:here.content.publications_mode=='priority'">
- <li><a href="addPublicationsFromPubman">Add an Entry</a></li>
- <li><a href="changePublications">Delete entries from the list or Change the priorities</a></li>
- 
- </ul>
- 
- </tal:block>
- </body>
- </html>
\ No newline at end of file
+    <h2>Selection mode</h2>
+    <form method="post" action="">
+     <input type="radio" name="selectionMode" value="year" tal:attributes="checked python:here.content.publications_mode=='year'" />
+      Show the five most recent publications. (no further action needed)
+      <input type="radio" name="selectionMode" value="priority"
+        tal:attributes="checked python:here.content.publications_mode=='priority'" />Show selected publications.
+      <input type="submit" name="submit" />
+    </form>
+
+    <ul tal:condition="python:here.content.publications_mode=='priority'">
+      <li><a href="addPublicationsFromPubman">Add an Entry</a></li>
+      <li><a href="changePublications">Delete entries from the list or Change the priorities</a></li>
+
+    </ul>
+
+  </tal:block>
+</body>
+</html>
\ No newline at end of file
--- a/zpt/staff/edit_shortEntry.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_shortEntry.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -5,7 +5,7 @@
 </head>
 <body>
 <tal:block metal:fill-slot="navsel" tal:define="global menusel string:research" />
-<tal:block metal:fill-slot="body" tal:define="yes_no_list python:'yes\nno'">
+<tal:block metal:fill-slot="body">
 
   <form action="" method="post">
   <input type="hidden" name="key" tal:attributes="value here/content/key"/>
@@ -21,12 +21,9 @@
       <td><input tal:attributes="name python:'current_work';
 				     value python:here.content.current_work" size="80" />
       </td>
-      <td
-        tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'publish',
-			     yes_no_list,
-			     boxType='radio',
-			     checked=here.content.current_work_p)" />
+      <td tal:define="name string:publish; value here/content/current_work_p;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+      </td>
     </tr>
   </table>
   <input type="submit" value="submit"/>
--- a/zpt/staff/edit_talks.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_talks.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -15,7 +15,7 @@
       <th>Priority</th>
       <th>Show</th>
     </tr>
-    <tr class="fliesstext" tal:repeat="found2 python:here.sortPriority(founds2)">
+    <tr tal:repeat="found2 founds2">
       <td valign="top">
         <input tal:attributes="name python:'talks__date__'+str(found2.oid); 
 				     value found2/date" size="10" />
@@ -31,12 +31,9 @@
       <td valign="top">
         <input tal:attributes="name python:'talks__priority__'+str(found2.oid); value found2/priority" size="3" />
       </td>
-      <td valign="top"
-        tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'talks__published__'+str(found2.oid),
-			     yes_no_list,
-			     boxType='radio',
-			     checked=found2.published)" />
+      <td valign="top" tal:define="name string:talks__published__${found2/oid}; value found2/published;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+      </td>
       <td>
         <a tal:attributes="href python:'deleteField?table=talks&key=%s'%found2.oid">delete</a>
       </td>
@@ -50,12 +47,9 @@
       <input tal:attributes="name python:'talks__place__new'" size="80" /> <br>
       <input tal:attributes="name python:'talks__link__new'" size="80" /></td>
       <td><input tal:attributes="name python:'talks__priority__new'" size="3"></td>
-      <td valign="top"
-        tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'talks__published__new',
-			     yes_no_list,
-			     boxType='radio',
-			     checked='yes')" />
+      <td valign="top" tal:define="name string:talks__published__new; value string:yes;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+      </td>
     </tr>
   </table>
   <input type="submit" value="submit">
--- a/zpt/staff/edit_teaching.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/staff/edit_teaching.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -4,7 +4,7 @@
 <body>
 <tal:block metal:fill-slot="navsel" tal:define="global menusel string:teaching" />
 
-<tal:block metal:fill-slot="body" tal:define="yes_no_list python:'yes\nno'">
+<tal:block metal:fill-slot="body">
   <form action="" method="post">
   <input type="hidden" name="key_main" tal:attributes="value python:here.content.key">
   <input type="hidden" name="main_fields" value="teaching__title">
@@ -15,7 +15,7 @@
       <th>Priority</th>
       <th>Show</th>
     </tr>
-    <tr class="fliesstext" tal:repeat="found2 python:here.sortPriority(founds2)">
+    <tr class="fliesstext" tal:repeat="found2 founds2">
       <td valign="top"><input tal:attributes="name python:'teaching__date__'+str(found2.oid); 
 				     value python:found2.date" size="10" />
       </td>
@@ -30,12 +30,9 @@
       <td valign="top"><input tal:attributes="name python:'teaching__priority__'+str(found2.oid);
 				     value found2/priority"
         size="3" /></td>
-      <td valign="top"
-        tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'teaching__published__'+str(found2.oid),
-			     yes_no_list,
-			     boxType='radio',
-			     checked=found2.published)" />
+      <td valign="top" tal:define="name string:teaching__published__${found2/oid}; value found2/published;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+      </td>
       <td><a tal:attributes="href python:'deleteField?table=teaching&oid=%s'%found2.oid">delete</a></td>
     </tr>
     <tr colspan="4">
@@ -47,12 +44,9 @@
       <input tal:attributes="name python:'teaching__place__new'" size="80" /> <br>
       <input tal:attributes="name python:'teaching__link__new'" size="80" /></td>
       <td><input tal:attributes="name python:'teaching__priority__new'" size="3"></td>
-      <td valign="top"
-        tal:content="structure python:here.ZSQLSelectionFromCRList(
-			     'teaching__published__new',
-			     yes_no_list,
-			     boxType='radio',
-			     checked='yes')" />
+      <td valign="top" tal:define="name string:teaching__published__new; value string:yes;">
+          <span metal:use-macro="here/common_template/macros/yesno_input_radio"/>
+      </td>
     </tr>
   </table>
   <input type="submit" value="submit">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/staff/manage_add_MPIWGStaffFolder.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,9 @@
+  <div tal:replace="structure here/manage_page_header">Header</div>
+  <h2>Add a MPIWGStaff folder</h2>
+  <form method="post" action="manage_addMPIWGStaffFolder">
+    <p class="form-label">ID</p>
+        <p class="form-element"><input size="80" name="id"/></p>
+    <p class="form-label">Title</p>
+        <p class="form-element"><input size="80" name="title"/></p>
+     <p><input type="submit" value="Add" /></p>
+  </form>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/staff/old/addMPIWGStaffForm.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -0,0 +1,22 @@
+<html>
+<head>
+   <title>The title</title>
+</head>
+<body>
+
+<div>
+
+<h1>Add a staff member</h1>
+<form method="post" action="manage_addMPIWGStaff">
+<p>ID = emailname
+<input name="id"></p>
+<p>LastName:
+<input name="lastName"/></p>
+<p>FirstName:
+<input name="firstName"/></p>
+
+<input type="submit">
+</form>
+</div>
+</body>
+</html>
--- a/zpt/www/common_template.zpt	Thu Jun 06 14:00:31 2013 +0200
+++ b/zpt/www/common_template.zpt	Thu Jun 06 15:34:20 2013 +0200
@@ -104,5 +104,17 @@
   </div>
   <!-- /two-column book entry -->
 
+  <!-- radiobutton for yes/no form.
+       @param name: parameter name
+       @param value: parameter value -->
+  <span metal:define-macro="yesno_input_radio">
+    <input type="radio" tal:attributes="name name; checked python:value=='yes'" value="yes"/>
+      yes
+    <input type="radio" tal:attributes="name name; checked python:value!='yes'" value="no"/>
+      no
+  </span>
+  <!-- /yesno_input_radio -->
+  
+  
 </body>
 </html>