changeset 22:5ed0b0c21fe5

started to clean up MPIWGProject.
author casties
date Mon, 08 Apr 2013 20:28:29 +0200
parents faa7c9e936a8
children 3825a9e17409
files MPIWGProjects.py MPIWGRoot.py css/edit.css css/mpiwg.css zpt/MPIWGProject_manageImagesForm.zpt zpt/MPIWGProject_managePublicationsForm.zpt zpt/MPIWGProject_manageRelatedProjectsForm.zpt zpt/edit_MPIWGBasisNeu.zpt zpt/edit_MPIWGProjectNeu.zpt zpt/edit_MPIWGProject_main.zpt zpt/project/edit_basic.zpt zpt/project/edit_description.zpt zpt/project/edit_images.zpt zpt/project/edit_publications.zpt zpt/project/edit_related_projects.zpt zpt/project/edit_template.zpt
diffstat 16 files changed, 459 insertions(+), 391 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGProjects.py	Fri Apr 05 19:01:59 2013 +0200
+++ b/MPIWGProjects.py	Mon Apr 08 20:28:29 2013 +0200
@@ -7,27 +7,30 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from Products.ZCatalog.CatalogPathAwareness import CatalogAware
-from Products.MPIWGBibliography.BibliographyManager import BibliographyManager
 from OFS.Image import Image
+from App.ImageFile import ImageFile
+from OFS.SimpleItem import SimpleItem
+from OFS.Folder import Folder
+from OFS.Image import Image
+from OFS.Cache import Cacheable
+from AccessControl import ClassSecurityInfo
+from AccessControl import getSecurityManager
 from Globals import package_home
 import urllib
 import re
 import os 
 import email
+import xmlhelper # Methoden zur Verwaltung der projekt xml
+import xmlrpclib
+import sys
 from types import *
 import logging
-import xmlhelper # Methoden zur Verwaltung der projekt xml
-from OFS.SimpleItem import SimpleItem
-from OFS.Folder import Folder
-from OFS.Image import Image
-from AccessControl import ClassSecurityInfo
-from AccessControl import getSecurityManager
+import time
+
+from SrvTxtUtils import getInt, unicodify, utf8ify, refreshingImageFileIndexHtml
+from Products.MPIWGBibliography.BibliographyManager import BibliographyManager
 from bibliography import *
-import time
-from OFS.Cache import Cacheable
-import xmlrpclib
 #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
@@ -260,6 +263,68 @@
     meta_type='MPIWGProject'
     default_catalog='ProjectCatalog'
     
+    manage_options = Folder.manage_options+(
+        {'label':'Load New File','action':'loadNewFileForm'},
+        {'label':'Edit','action':'editForm'},
+        )
+
+        #{'label':'Edit ProjectInfo','action':'editMPIWGProjectForm'},
+        #{'label':'Edit BasisInfo','action':'editMPIWGBasisForm'},
+        #{'label':'Edit Publications','action':'editMPIWGRelatedPublicationsForm'},
+        #{'label':'Edit Themes & Disciplines','action':'editMPIWGDisciplinesThemesForm'},
+        #{'label':'Versionmanager','action':'versionManageForm'},
+
+
+    # TODO: fix this
+    fieldLabels={'WEB_title':'WEB_Title',
+             'xdata_01':'Responsible Scientists',
+             'xdata_02':'Department',
+             'xdata_03':'Historical Persons',
+             'xdata_04':'Time period',
+             'xdata_05':'Sorting number',
+             'xdata_06':'Keywords',
+             'xdata_07':'Short title',
+             'xdata_08':'Other involved scholars' ,
+             'xdata_09':'Disciplines',
+             'xdata_10':'Themes',
+             'xdata_11':'Object Digitallibrary',
+             'xdata_12':'Cooperation partners',
+             'xdata_13':'Funding institutions',
+             'WEB_project_header':'WEB_project_header',
+             'WEB_project_description':'WEB_project_description',
+             'WEB_related_pub':'WEB_related_pub'}
+
+    checkFields = ['xdata_01']
+
+    edit_css = ImageFile('css/edit.css', globals())
+    # make css refreshable for development
+    edit_css.index_html = refreshingImageFileIndexHtml
+    editForm = PageTemplateFile('zpt/project/edit_description', globals())
+    edit_template = PageTemplateFile('zpt/project/edit_template', globals())
+    # TODO: compat
+    edit_MPIWGProject_main = edit_template
+
+
+    def __init__(self, id, argv=None):
+        """initiere classe"""
+
+        self.creationTime=time.strftime("%Y%m%d%H%M%S",time.localtime())[0:]
+        self.id=id
+        self.title=id
+        self.isActiveFlag=True #Flag is true is the project is still active, False if accomplished
+        self.responsibleScientistsList=[] # enthaelt die Lister der verantwortlichen Wissenschaftler in der Form (NAME, KEY), key ist "" flass Wissenschaftler nicht an unserem Haus
+        
+        if argv:
+            for arg in definedFields:
+                try:
+                        setattr(self,arg,argv[arg])
+                except:
+                        setattr(self,arg,"")
+        else:
+            for arg in definedFields:
+                setattr(self,arg,'')
+            
+
     def redirect(self,RESPONSE,url):
         """mache ein redirect mit einem angehaengten time stamp um ein reload zu erzwingen"""
         
@@ -277,6 +342,10 @@
     def decode(self,str):
         """return unicode object"""
         return unicodify(str)
+
+    def isCheckField(self,fieldname):
+        """return chechfield"""
+        return (fieldname in checkFields)
  
     def sortedByPlace(self,metatype):
         """find metatype and sort by place"""
@@ -436,7 +505,7 @@
                         pass
 
 
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGProject_manageImagesForm.zpt')).__of__(self)
+        pt = PageTemplateFile('zpt/project/edit_images', globals()).__of__(self)
         return pt()
 
     def managePublications(self,pubName=None,op=None):
@@ -464,7 +533,7 @@
                         pass
 
 
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGProject_managePublicationsForm.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/project/edit_publications', globals()).__of__(self)
         return pt()
     
     def manageRelatedProjects(self,pubName=None,op=None):
@@ -492,7 +561,7 @@
                         pass
 
 
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','MPIWGProject_manageRelatedProjectsForm.zpt')).__of__(self)
+        pt=PageTemplateFile('zpt/project/edit_related_projects', globals()).__of__(self)
         return pt()
     
     
@@ -870,35 +939,6 @@
         if RESPONSE is not None:
             self.redirect(RESPONSE,'manage_main')
             
-    def __init__(self, id, argv=None):
-        """initiere classe"""
-
-        self.creationTime=time.strftime("%Y%m%d%H%M%S",time.localtime())[0:]
-        self.id=id
-        self.title=id
-        self.isActiveFlag=True #Flag is true is the project is still active, False if accomplished
-        self.responsibleScientistsList=[] # enthaelt die Lister der verantwortlichen Wissenschaftler in der Form (NAME, KEY), key ist "" flass Wissenschaftler nicht an unserem Haus
-        
-        if argv:
-            for arg in definedFields:
-                try:
-                        setattr(self,arg,argv[arg])
-                except:
-                        setattr(self,arg,"")
-        else:
-            for arg in definedFields:
-                setattr(self,arg,'')
-            
-    manage_options = Folder.manage_options+(
-        {'label':'Load New File','action':'loadNewFileForm'},
-        {'label':'Edit ProjectInfo','action':'editMPIWGProjectForm'},
-        {'label':'Edit BasisInfo','action':'editMPIWGBasisForm'},
-        {'label':'Edit Publications','action':'editMPIWGRelatedPublicationsForm'},
-        {'label':'Edit Themes & Disciplines','action':'editMPIWGDisciplinesThemesForm'},
-        {'label':'Versionmanager','action':'versionManageForm'},
-        )
-
-
     def isActiveProject(self):
         """check if the project is still active, default is true, set to false is the project is accomplished"""
         return getattr(self,'isActiveFlag',True)
@@ -1327,11 +1367,10 @@
         if western:
             self.REQUEST.RESPONSE.setCookie("MP_debug_code","western",path="/")
 
-            
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGProjectNeu.zpt')).__of__(self)
+        #pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGProjectNeu.zpt')).__of__(self)
+        pt = self.editForm
         return pt()
     
-    edit_MPIWGProject_main = PageTemplateFile('zpt/edit_MPIWGProject_main', globals())
 
     def getPathStyle(self, path, selected, style=""):
         """returns a string with the given style + 'sel' if path == selected."""
@@ -1662,16 +1701,16 @@
                 return 1
         return 0
 
-    security.declareProtected('View management screens','editMPIWGBasisEditor')
-    def editMPIWGBasisEditor(self, identifiedNames=None):
+    security.declareProtected('View management screens','editBasic')
+    def editBasic(self, identifiedNames=None):
                             
         """editform"""
         if not identifiedNames:
             identifiedNames=self.identifyNames(self.getContent('xdata_01'))
            # identifiedNames=self.getFullNameEntries()
         
-        logging.error("IdentifiedNames: %s"% repr(identifiedNames))
-        pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGBasisNeu.zpt')).__of__(self)
+        logging.debug("IdentifiedNames: %s"%repr(identifiedNames))
+        pt=PageTemplateFile('zpt/project/edit_basic', globals()).__of__(self)
         return pt(identifiedNames=identifiedNames)
 
     security.declareProtected('View management screens','editMPIWGBasisForm')
--- a/MPIWGRoot.py	Fri Apr 05 19:01:59 2013 +0200
+++ b/MPIWGRoot.py	Mon Apr 08 20:28:29 2013 +0200
@@ -53,6 +53,7 @@
         #{'label':'Store Historical Persons','action':'storeHistoricalPersons'},
         )
 
+    # TODO: is this used here?
     fieldLabels={'WEB_title':'WEB_Title',
                  'xdata_01':'Responsible Scientists',
                  'xdata_02':'Department',
@@ -1269,9 +1270,9 @@
             return x
         
 
+    # TODO: do we need this here?
     def isCheckField(self,fieldname):
         """return chechfield"""
-        
         return (fieldname in checkFields)
 
     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/css/edit.css	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,43 @@
+@CHARSET "UTF-8";
+
+.title {
+    color: #010658;
+}
+div.content {
+    padding: 5px 5px 5px 5px;
+    margin-top: 5px;
+    background-color: #eeeeee;
+}
+div.mainnav a {
+   font-weight: bold;
+}
+.mainmenu {
+    padding: 5px 5px 5px 5px;
+    margin-bottom: 5px;
+    background-color: #000066;
+}
+.mainmenu a {
+    text-decoration: none;
+    font-weight: bold;
+    color: #ffffff;
+}
+.mainmenusel {
+    border-width: 3px;
+    border-color: #000066;
+    border-style: solid solid none solid;
+    padding: 5px 5px 5px 5px;
+    margin-bottom: 5px;
+    background-color: #eeeeee;
+}
+.mainmenusel a {
+    text-decoration: none;
+    font-weight: bold;
+    color: #000066;
+}
+#kupu-toolbox-links {
+    display : none;
+}
+
+#kupu-toolbox-images {
+    display : none;
+}
--- a/css/mpiwg.css	Fri Apr 05 19:01:59 2013 +0200
+++ b/css/mpiwg.css	Mon Apr 08 20:28:29 2013 +0200
@@ -425,7 +425,7 @@
     font-weight: normal;
     margin-top: 0;
 }
-/* "current research topic */
+/* current research topic */
 div.teaser_text h2 {
 	font-size: 14px;
     color: #887163;
--- a/zpt/MPIWGProject_manageImagesForm.zpt	Fri Apr 05 19:01:59 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-<!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/edit_MPIWGProject_main/macros/page">
-<head>
-</head>
-<body>
-<tal:block metal:fill-slot="navsel" tal:define="global menusel string:images" />
-<tal:block metal:fill-slot="body">
-  <table tal:condition="python:here.getImages()">
-    <tr><th/><th>Image</th><th>Caption</th><th/></tr>
-    <tal:block tal:repeat="image here/getImages">
-      <tr>
-        <td>
-          <a tal:attributes="href python:here.absolute_url()+'/manageImages?imageName='+image[0]+'&op=up'">up</a><br>
-          <a tal:attributes="href python:here.absolute_url()+'/manageImages?imageName='+image[0]+'&op=down'">down</a>
-        </td>
-        <td tal:condition="not:python:image[1].height==''" tal:content="structure python:image[1].tag(scale=250.0 / image[1].height)" />
-	<td tal:condition="python:image[1].height==''" tal:content="python:image[1].height"/>
-        <td tal:content="structure python:getattr(image[1],'caption','')" />
-        <td>
-          <a tal:attributes="href python:image[1].getId()+'/editImage'">Edit</a><br/>
-          <a tal:attributes="href python:'deleteImage?id='+image[1].getId()">Delete</a>
-        </td>
-      </tr>
-    </tal:block>
-  </table>
-  
-  <h3>Add an Image</h3>
-  
-  <form action="addImage" method="post" enctype="multipart/form-data">
-  <table>
-    <tr><th>Image</th><th>Caption</th></tr>
-    <tr>
-      <td><input name="fileHd" type="file" len="50"/></td>
-      <td><textarea name="caption" rows="3" cols="60"></textarea></td>
-    </tr>
-  </table>
-  <p><input type="submit" value="submit"/></p>
-  </form>
-  
-  <p>(if the marginal image from your current project description is not occuring in this list, click <a href="copyImageToMargin">here</a>.)</p>
-</tal:block>
-</body>
-</html>
--- a/zpt/MPIWGProject_managePublicationsForm.zpt	Fri Apr 05 19:01:59 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<!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/edit_MPIWGProject_main/macros/page">
-<head>
-</head>
-<body>
-<tal:block metal:fill-slot="navsel" tal:define="global menusel string:publications" />
-<tal:block metal:fill-slot="body">
-  <table>
-    <tal:block tal:repeat="publication here/getPublications">
-      <tr>
-        <td>
-          <a tal:attributes="href python:here.absolute_url()+'/managePublications?pubName='+publication[0]+'&op=up'">up</a><br>
-          <a tal:attributes="href python:here.absolute_url()+'/managePublications?pubName='+publication[0]+'&op=down'">down</a>
-        </td>
-        <td tal:content="structure python:getattr(publication[1],'text','')" />
-        <td>
-          <a tal:attributes="href python:publication[1].getId()+'/editPublication'">Edit</a><br/> 
-          <a tal:attributes="href python:'deletePublication?id='+publication[1].getId()">Delete</a>
-        </td>
-      </tr>
-    </tal:block>
-  </table>
-
-  <h3>Add a publication</h3>
-  <form action="addPublication" method="post">
-    <textarea name="text" rows="3" cols="80"></textarea>
-    <p><input type="submit" value="submit"/></p>
-  </form>
-  <p>(If the publications from your current project description are not showing in this list, click <a href="copyPublicationsToList">here</a> to copy them.)</p>
-<h3><tal:x condition="python:here.hasExtendedPublicationList()">
-		<a href="publicationList/editEntries">
-		Manage Extended Publication List</a>
-		</tal:x>
-		<tal:x condition="not:python:here.hasExtendedPublicationList()">
-		<a href="createExtendedPublicationList">
-		Create Extended Publication List</a>
-		</tal:x>
-</h3>
-</tal:block>
-</body>
-</html>
--- a/zpt/MPIWGProject_manageRelatedProjectsForm.zpt	Fri Apr 05 19:01:59 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<!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/edit_MPIWGProject_main/macros/page">
-<head>
-</head>
-<body>
-<tal:block metal:fill-slot="navsel" tal:define="global menusel string:relatedProjects" />
-<tal:block metal:fill-slot="body">
-  <table>
-    <tal:block tal:repeat="publication here/getRelatedProjects">
-      <tr>
-        <td>
-          <a tal:attributes="href python:here.absolute_url()+'/manageRelatedProjects?pubName='+publication[0]+'&op=up'">up</a><br>
-          <a tal:attributes="href python:here.absolute_url()+'/manageRelatedProjects?pubName='+publication[0]+'&op=down'">down</a>
-        </td>
-        <td tal:content="structure python:getattr(publication[1],'objid','')" />
-        <td tal:content="structure python:getattr(publication[1],'projectWEB_title','')" />
-        <td>
-          <a tal:attributes="href python:publication[1].getId()+'/editRelatedProject'">Edit</a><br/> 
-          <a tal:attributes="href python:'deleteRelatedProject?id='+publication[1].getId()">Delete</a>
-        </td>
-      </tr>
-    </tal:block>
-  </table>
-
-  <h3>Add related projects</h3>
-  <p>Please add the link to the project you want to add a relation to.</p>
-  <form action="addRelatedProject" method="post">
-    <input name="link" size="100">
-    <p><input type="submit" value="submit"/></p>
-  </form>
- 
-</tal:block>
-</body>
-</html>
--- a/zpt/edit_MPIWGBasisNeu.zpt	Fri Apr 05 19:01:59 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-<!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/edit_MPIWGProject_main/macros/page">
-<head>
-</head>
-<body>
-<tal:block metal:fill-slot="navsel" tal:define="global menusel string:basis" />
-<tal:block metal:fill-slot="body">
-  <form method="POST" action="editMPIWGProject">
-  <input type="hidden" name="fromEdit" value="yes" />
-  <table>
-    <tr>
-      <td><b>Project Title</b></td>
-      <td>
-        <input tal:attributes="name python:'WEB_title'; value python:here.getContent('WEB_title')" size="80"/>
-      </td>
-    </tr>
-    <tal:block tal:repeat="field here/getDataFields">
-      <tr>
-        <td><b tal:content="python:here.fieldLabels[field]"/></td>
-        <td><input tal:attributes="name field; value python:here.getContent(field)" size=80 /></td>
-      </tr>
-      <tr tal:condition="python:here.isCheckField(field)">
-        <td/>
-        <td><tal:block tal:define="checkList python:here.giveCheckList(here,field)">
-          <tal:block repeat="item checkList/keys">
-            <span tal:replace="item" />: 
-            <tal:block tal:condition="python:len(checkList[item])>0">found</tal:block> 
-            <tal:block tal:condition="not:python:len(checkList[item])>0"><font color="#ff0000">not found</font></tal:block>
-          </tal:block>
-          <br>
-        </tal:block></td>
-      </tr>
-    </tal:block>
-<!--    <tr>
-     <td><b>Historical names (new)</b><br/>
-     Please names enter as <br>
-      LASTNAME,FIRSTNAME <br/>or LASTNAME,FIRSTNAME MIDDLE.. <br> with 
-     <em>no space</em> before FIRSTNAME
-     </td>
-     <td><textarea name="historicalNames" tal:content="python:'\n'.join(here.getNamesInProject(here.getId()))" rows="10" cols="30">NAMES</textarea>
-     </td>
-    </tr> 
-    -->
-        <tr tal:define="hasChildren python:here.hasChildren()">
-    	<td>Project is visible</td>
-    	 <tal:x tal:condition="python:hasChildren and here.isActiveProject()" >
-	      <td>visible (status cannot be changed, because the project has visible children.)
-	       <input tal:attributes="name python:'active'" value="true" type="hidden">
-	      </td>
-	     </tal:x>
-    	 <tal:x tal:condition="python:(not hasChildren) or (hasChildren and not here.isActiveProject())">
-	      <td tal:condition="python:here.isActiveProject()" >
-			<input tal:attributes="name python:'active'" value="true" checked type="checkbox">
-		
-	      </td>
-	      <td tal:condition="not:python:here.isActiveProject()">
-		    <input tal:attributes="name python:'active'" value="true" type="checkbox">
-	    	<tal:x tal:condition="python:hasChildren" >
-			 	 WARNING: This project is not visible, but has visible children.
-			</tal:x>
-	      </td>
-	    </tal:x>
-	 </tr>
-	 <tr>
-	 	<td>Completed at:</td>
-	 	<td>
-			<input tal:attributes="name python:'completedAt';
-								   value python:here.getCompletedAt()"
-								   type="text" len="15"/>
-			(format dd.mm.yyyy or mm.yyyy or yyyy)
-			</td>
-	</tr>
-		 <tr>
-	 	<td>Startet at:</td>
-	 	<td>
-			<input tal:attributes="name python:'startedAt';
-								   value python:here.getStartedAt()"
-								   type="text" len="15"/>
-			(format dd.mm.yyyy or mm.yyyy or yyyy)
-			</td>
-	</tr>
-	 	
-  </table>
- 
-  
-  <h2>Names</h2>
-  <table tal:define="global count python:0">
- 
-<tr tal:repeat="identifiedName python:options.get('identifiedNames',{}).items()">
-		<tal:x tal:define="global count python:count+1"/>
-  		<td><input type="hidden" tal:attributes="value python:here.decode(identifiedName[0]);
-  												 name python:'responsibleScientist_name_%s'%count"/>
-  			<span tal:replace="python:identifiedName[0]"/></td>
-  		<td>
-  		<table>
-  		<tr tal:repeat="member python:identifiedName[1]">
-  		 	<tal:y define="memberObj member/getObject">
-  				<td tal:content="python:here.decode(memberObj.getKey())"/>
-  				<td tal:content="python:memberObj.getId()"/>
-  				<tal:x condition="python:here.isResponsibleScientist(memberObj.getKey())">
-  					<td><input type="checkbox" tal:attributes="name python:'responsibleScientist_key_%s'%count;
-  																			value python:here.decode(memberObj.getKey())"
-  												checked/></td>
-  					
- 				</tal:x>
- 				<tal:x condition="not:python:here.isResponsibleScientist(memberObj.getKey())">
-  					<td><input type="checkbox"  tal:attributes="name python:'responsibleScientist_key_%s'%count;
-  																			value python:here.decode(memberObj.getKey())"
-  												/></td>
-  				
- 				</tal:x>
-  			
-  			</tal:y>
-  		</tr>
-  		</table>
-  		
-  		</td>
-	</tr>
-
-  	</table>	
-  	<p><input type="submit" value="change"/></p>
-  </form>
-  	
-  </tal:block>
-</body>
-</html>
--- a/zpt/edit_MPIWGProjectNeu.zpt	Fri Apr 05 19:01:59 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-<!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/edit_MPIWGProject_main/macros/page" xmlns:metal="http://xml.zope.org/namespaces/metal" >
-<head>
-<tal:block metal:fill-slot="navsel" tal:define="global menusel string:description" />
-</head>
-<body>
-<tal:block metal:fill-slot="body">
-  <form action="saveEditedContent" method="POST">
-    <div>
-      <span class="kupu-tb-buttongroup">
-        <button type="button" id="kupu-preview-button" title="preview: alt-p" accesskey="p">Preview</button>
-      </span>
-      <span class="kupu-tb-buttongroup">
-        <button type="button" id="kupu-save-button" title="save: alt-s" accesskey="s">Publish</button>
-      </span>
-    </div>
-    <metal:macros use-macro="here/kupuEditor/kupumacros/macros/xmlconfig">
-      <metal:macros fill-slot="dst">saveEditedContent</metal:macros>
-    </metal:macros>
-    <metal:macros use-macro="here/kupuEditor/kupumacros/macros/fulleditor">
-      <metal:macros fill-slot="tb_select_styles">
-        <select id="kupu-tb-styles">
-          <option xmlns:i18n="http://xml.zope.org/namespaces/i18n" value="P" i18n:translate="">
-            Normal
-          </option>
-          <option value="H3">
-            <span xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:translate="">Heading</span>
-          </option>
-        </select>
-      </metal:macros>
-      <metal:macros fill-slot="toolbox_properties">
-        <div class="kupu-toolbox" id="kupu-toolbox-properties">
-          <input type="hidden" class="wide" id="kupu-properties-title"/> 
-          <input type="hidden" class="wide" id="kupu-properties-description"/>
-        </div>
-      </metal:macros>
-      <metal:macros fill-slot="toolbox_tables">
-        <div class="kupu-toolbox" id="kupu-toolbox-properties">
-          <input type="hidden" class="wide" id="kupu-table-classchooser"/> 
-          <input type="hidden" class="wide" id="kupu-table-newrows" />
-          <input type="hidden" class="wide" id="kupu-table-newcols" />
-        </div>
-      </metal:macros>
-      <metal:macros fill-slot="editorframe">
-        <tal:block tal:condition="not:python:here.REQUEST.get('fromPreview',None)">
-          <iframe class="kupu-editor-iframe" id="kupu-editor" frameborder="0" scrolling="auto" src="fulldoc"
-            tal:attributes="src python:here.absolute_url()+'/getWebProject_description'"> </iframe>
-        </tal:block>
-        <tal:block tal:condition="python:here.REQUEST.get('fromPreview',None)">
-          <iframe class="kupu-editor-iframe" id="kupu-editor" frameborder="0" scrolling="auto" src="fulldoc"
-            tal:attributes="src python:here.absolute_url()+'/previewTemplate/getWebProject_description'"> </iframe>
-        </tal:block>
-      </metal:macros>
-    </metal:macros>
-    <p></p>
-  </form>
-</tal:block>
-</body>
-</html>
--- a/zpt/edit_MPIWGProject_main.zpt	Fri Apr 05 19:01:59 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-<!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">
-<head>
-<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>
-    <script type="text/javascript" src="/kupuEditor/kupustart_form.js"> </script>
-  </metal:macros>
-</metal:macros>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel="stylesheet" href="edit.css" type="text/css"/>  
-</head>
-<body onload="kupu = startKupu();">
-  <h3 tal:condition="not:here/isActiveProject">(!!Project is not visible!!)</h3>
-  <h2 class="title">Edit project <i tal:content="python:here.getContent('WEB_title')"/></h2>
-  <metal:block metal:define-slot="navsel"/>
-  <div class="mainnav">
-    <span tal:attributes="class python:here.getPathStyle('basis', menusel, 'mainmenu')"><a href="editMPIWGBasisEditor">Basic information</a></span>
-    <span tal:attributes="class python:here.getPathStyle('description', menusel, 'mainmenu')"><a href="edit">Project description</a></span>
-    <span tal:attributes="class python:here.getPathStyle('images', menusel, 'mainmenu')"><a href="manageImages">Images</a></span>
-    <span tal:attributes="class python:here.getPathStyle('publications', menusel, 'mainmenu')"><a href="managePublications">Publications</a></span>
-    <span tal:attributes="class python:here.getPathStyle('relatedProjects', menusel, 'mainmenu')"><a href="manageRelatedProjects">Related Projects</a></span>
-    <span tal:attributes="class python:here.getPathStyle('themes', menusel, 'mainmenu')"><a href="tagTheProject">Tags</a></span>
-    <span class="mainmenu"><a target="_blank" href="index_html">View</a></span>
-  </div>
-  <div class="content">
-  <tal:block metal:define-slot="body"/>
-  </div>
-</body>
-</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/edit_basic.zpt	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,108 @@
+<!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/edit_template/macros/page">
+<head>
+</head>
+<body>
+  <tal:block metal:fill-slot="navsel" tal:define="global menusel string:basic" />
+  <tal:block metal:fill-slot="body">
+    <form method="post" action="editMPIWGProject">
+      <input type="hidden" name="fromEdit" value="yes" />
+      <table>
+        <tr>
+          <td><b>Project Title</b></td>
+          <td><input tal:attributes="name python:'WEB_title'; value python:here.getContent('WEB_title')" size="80" /></td>
+        </tr>
+        <tal:block tal:repeat="field here/getDataFields">
+          <tr>
+            <td><b tal:content="python:here.fieldLabels[field]" /></td>
+            <td><input tal:attributes="name field; value python:here.getContent(field)" size=80 /></td>
+          </tr>
+          <tr tal:condition="python:here.isCheckField(field)">
+            <td />
+            <td><tal:block tal:define="checkList python:here.giveCheckList(here,field)">
+                <tal:block repeat="item checkList/keys">
+                  <span tal:replace="item" />: 
+                  <tal:block tal:condition="python:len(checkList[item])>0">found</tal:block>
+                  <tal:block tal:condition="not:python:len(checkList[item])>0">
+                    <font color="#ff0000">not found</font>
+                  </tal:block>
+                </tal:block>
+                <br />
+              </tal:block></td>
+          </tr>
+        </tal:block>
+        <!--    <tr>
+     <td><b>Historical names (new)</b><br/>
+     Please names enter as <br>
+      LASTNAME,FIRSTNAME <br/>or LASTNAME,FIRSTNAME MIDDLE.. <br> with 
+     <em>no space</em> before FIRSTNAME
+     </td>
+     <td><textarea name="historicalNames" tal:content="python:'\n'.join(here.getNamesInProject(here.getId()))" rows="10" cols="30">NAMES</textarea>
+     </td>
+    </tr> 
+    -->
+        <tr tal:define="hasChildren python:here.hasChildren()">
+          <td>Project is visible</td>
+          <tal:x tal:condition="python:hasChildren and here.isActiveProject()">
+            <td>visible (status cannot be changed, because the project has visible children.) <input
+              tal:attributes="name python:'active'" value="true" type="hidden"></td>
+          </tal:x>
+          <tal:x tal:condition="python:(not hasChildren) or (hasChildren and not here.isActiveProject())">
+            <td tal:condition="python:here.isActiveProject()"><input tal:attributes="name python:'active'" value="true" checked
+              type="checkbox"></td>
+            <td tal:condition="not:python:here.isActiveProject()"><input tal:attributes="name python:'active'" value="true"
+              type="checkbox"> <tal:x tal:condition="python:hasChildren">
+			 	 WARNING: This project is not visible, but has visible children.
+			</tal:x></td>
+          </tal:x>
+        </tr>
+        <tr>
+          <td>Started at:</td>
+          <td><input tal:attributes="name python:'startedAt';
+								   value python:here.getStartedAt()" type="text" len="15" />
+            (format dd.mm.yyyy or mm.yyyy or yyyy)</td>
+        </tr>
+        <tr>
+          <td>Completed at:</td>
+          <td><input tal:attributes="name python:'completedAt';
+                   value python:here.getCompletedAt()"
+            type="text" len="15" /> (format dd.mm.yyyy or mm.yyyy or yyyy)</td>
+        </tr>
+
+      </table>
+
+
+      <h2>Names</h2>
+      <table tal:define="global count python:0">
+        <tr tal:repeat="identifiedName python:options.get('identifiedNames',{}).items()">
+          <tal:x tal:define="global count python:count+1" />
+          <td><input type="hidden"
+            tal:attributes="value python:here.decode(identifiedName[0]); name python:'responsibleScientist_name_%s'%count" /> <span
+            tal:replace="python:identifiedName[0]" /> <!-- <pre tal:content="python:repr(identifiedName)"/> --></td>
+          <td>
+            <table>
+              <tr tal:repeat="member python:identifiedName[1]">
+                <tal:y define="memberObj member/getObject">
+                  <td tal:content="python:here.decode(memberObj.getKey())" />
+                  <td tal:content="python:memberObj.getId()" />
+                  <td><input type="checkbox"
+                    tal:attributes="name python:'responsibleScientist_key_%s'%count; value python:memberObj.getKey();
+                      checked python:here.isResponsibleScientist(memberObj.getKey())" />
+                  </td>
+                </tal:y>
+              </tr>
+            </table>
+
+          </td>
+        </tr>
+
+      </table>
+      <p>
+        <input type="submit" value="change" />
+      </p>
+    </form>
+
+  </tal:block>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/edit_description.zpt	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,69 @@
+<!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/edit_template/macros/page" xmlns:metal="http://xml.zope.org/namespaces/metal" >
+<head>
+<metal:block metal:fill-slot="html_head">
+<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>
+    <script type="text/javascript" src="/kupuEditor/kupustart_form.js"> </script>
+  </metal:macros>
+</metal:macros>
+<tal:block tal:define="global onload string:kupu = startKupu();"/>
+</metal:block>
+</head>
+<body>
+<tal:block metal:fill-slot="navsel" tal:define="global menusel string:description" />
+<tal:block metal:fill-slot="body">
+  <form action="saveEditedContent" method="POST">
+    <div>
+      <span class="kupu-tb-buttongroup">
+        <button type="button" id="kupu-preview-button" title="preview: alt-p" accesskey="p">Preview</button>
+      </span>
+      <span class="kupu-tb-buttongroup">
+        <button type="button" id="kupu-save-button" title="save: alt-s" accesskey="s">Publish</button>
+      </span>
+    </div>
+    <metal:macros use-macro="here/kupuEditor/kupumacros/macros/xmlconfig">
+      <metal:macros fill-slot="dst">saveEditedContent</metal:macros>
+    </metal:macros>
+    <metal:macros use-macro="here/kupuEditor/kupumacros/macros/fulleditor">
+      <metal:macros fill-slot="tb_select_styles">
+        <select id="kupu-tb-styles">
+          <option xmlns:i18n="http://xml.zope.org/namespaces/i18n" value="P" i18n:translate="">
+            Normal
+          </option>
+          <option value="H3">
+            <span xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:translate="">Heading</span>
+          </option>
+        </select>
+      </metal:macros>
+      <metal:macros fill-slot="toolbox_properties">
+        <div class="kupu-toolbox" id="kupu-toolbox-properties">
+          <input type="hidden" class="wide" id="kupu-properties-title"/> 
+          <input type="hidden" class="wide" id="kupu-properties-description"/>
+        </div>
+      </metal:macros>
+      <metal:macros fill-slot="toolbox_tables">
+        <div class="kupu-toolbox" id="kupu-toolbox-properties">
+          <input type="hidden" class="wide" id="kupu-table-classchooser"/> 
+          <input type="hidden" class="wide" id="kupu-table-newrows" />
+          <input type="hidden" class="wide" id="kupu-table-newcols" />
+        </div>
+      </metal:macros>
+      <metal:macros fill-slot="editorframe">
+        <tal:block tal:condition="not:python:here.REQUEST.get('fromPreview',None)">
+          <iframe class="kupu-editor-iframe" id="kupu-editor" frameborder="0" scrolling="auto" src="fulldoc"
+            tal:attributes="src python:here.absolute_url()+'/getWebProject_description'"> </iframe>
+        </tal:block>
+        <tal:block tal:condition="python:here.REQUEST.get('fromPreview',None)">
+          <iframe class="kupu-editor-iframe" id="kupu-editor" frameborder="0" scrolling="auto" src="fulldoc"
+            tal:attributes="src python:here.absolute_url()+'/previewTemplate/getWebProject_description'"> </iframe>
+        </tal:block>
+      </metal:macros>
+    </metal:macros>
+    <p></p>
+  </form>
+</tal:block>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/edit_images.zpt	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,44 @@
+<!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/edit_template/macros/page">
+<head>
+</head>
+<body>
+<tal:block metal:fill-slot="navsel" tal:define="global menusel string:images" />
+<tal:block metal:fill-slot="body">
+  <table tal:condition="python:here.getImages()">
+    <tr><th/><th>Image</th><th>Caption</th><th/></tr>
+    <tal:block tal:repeat="image here/getImages">
+      <tr>
+        <td>
+          <a tal:attributes="href python:here.absolute_url()+'/manageImages?imageName='+image[0]+'&op=up'">up</a><br>
+          <a tal:attributes="href python:here.absolute_url()+'/manageImages?imageName='+image[0]+'&op=down'">down</a>
+        </td>
+        <td tal:condition="not:python:image[1].height==''" tal:content="structure python:image[1].tag(scale=250.0 / image[1].height)" />
+	<td tal:condition="python:image[1].height==''" tal:content="python:image[1].height"/>
+        <td tal:content="structure python:getattr(image[1],'caption','')" />
+        <td>
+          <a tal:attributes="href python:image[1].getId()+'/editImage'">Edit</a><br/>
+          <a tal:attributes="href python:'deleteImage?id='+image[1].getId()">Delete</a>
+        </td>
+      </tr>
+    </tal:block>
+  </table>
+  
+  <h3>Add an Image</h3>
+  
+  <form action="addImage" method="post" enctype="multipart/form-data">
+  <table>
+    <tr><th>Image</th><th>Caption</th></tr>
+    <tr>
+      <td><input name="fileHd" type="file" len="50"/></td>
+      <td><textarea name="caption" rows="3" cols="60"></textarea></td>
+    </tr>
+  </table>
+  <p><input type="submit" value="submit"/></p>
+  </form>
+  
+  <p>(if the marginal image from your current project description is not in this list, click <a href="copyImageToMargin">here</a>.)</p>
+</tal:block>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/edit_publications.zpt	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,42 @@
+<!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/edit_template/macros/page">
+<head>
+</head>
+<body>
+<tal:block metal:fill-slot="navsel" tal:define="global menusel string:publications" />
+<tal:block metal:fill-slot="body">
+  <table>
+    <tal:block tal:repeat="publication here/getPublications">
+      <tr>
+        <td>
+          <a tal:attributes="href python:here.absolute_url()+'/managePublications?pubName='+publication[0]+'&op=up'">up</a><br>
+          <a tal:attributes="href python:here.absolute_url()+'/managePublications?pubName='+publication[0]+'&op=down'">down</a>
+        </td>
+        <td tal:content="structure python:getattr(publication[1],'text','')" />
+        <td>
+          <a tal:attributes="href python:publication[1].getId()+'/editPublication'">Edit</a><br/> 
+          <a tal:attributes="href python:'deletePublication?id='+publication[1].getId()">Delete</a>
+        </td>
+      </tr>
+    </tal:block>
+  </table>
+
+  <h3>Add a publication</h3>
+  <form action="addPublication" method="post">
+    <textarea name="text" rows="3" cols="80"></textarea>
+    <p><input type="submit" value="submit"/></p>
+  </form>
+  <p>(If the publications from your current project description are not showing in this list, click <a href="copyPublicationsToList">here</a> to copy them.)</p>
+<h3><tal:x condition="python:here.hasExtendedPublicationList()">
+		<a href="publicationList/editEntries">
+		Manage Extended Publication List</a>
+		</tal:x>
+		<tal:x condition="not:python:here.hasExtendedPublicationList()">
+		<a href="createExtendedPublicationList">
+		Create Extended Publication List</a>
+		</tal:x>
+</h3>
+</tal:block>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/edit_related_projects.zpt	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,35 @@
+<!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/edit_MPIWGProject_main/macros/page">
+<head>
+</head>
+<body>
+<tal:block metal:fill-slot="navsel" tal:define="global menusel string:relatedProjects" />
+<tal:block metal:fill-slot="body">
+  <table>
+    <tal:block tal:repeat="publication here/getRelatedProjects">
+      <tr>
+        <td>
+          <a tal:attributes="href python:here.absolute_url()+'/manageRelatedProjects?pubName='+publication[0]+'&op=up'">up</a><br>
+          <a tal:attributes="href python:here.absolute_url()+'/manageRelatedProjects?pubName='+publication[0]+'&op=down'">down</a>
+        </td>
+        <td tal:content="structure python:getattr(publication[1],'objid','')" />
+        <td tal:content="structure python:getattr(publication[1],'projectWEB_title','')" />
+        <td>
+          <a tal:attributes="href python:publication[1].getId()+'/editRelatedProject'">Edit</a><br/> 
+          <a tal:attributes="href python:'deleteRelatedProject?id='+publication[1].getId()">Delete</a>
+        </td>
+      </tr>
+    </tal:block>
+  </table>
+
+  <h3>Add related projects</h3>
+  <p>Please add the link to the project you want to add a relation to.</p>
+  <form action="addRelatedProject" method="post">
+    <input name="link" size="100">
+    <p><input type="submit" value="submit"/></p>
+  </form>
+ 
+</tal:block>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/project/edit_template.zpt	Mon Apr 08 20:28:29 2013 +0200
@@ -0,0 +1,26 @@
+<!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">
+<head tal:define="global onload nothing;">
+<metal:block metal:define-slot="html_head"/>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" href="edit_css" type="text/css"/>  
+</head>
+<body tal:attributes="onload onload">
+  <h3 tal:condition="not:here/isActiveProject">(!!Project is not visible!!)</h3>
+  <h2 class="title">Edit project <i tal:content="python:here.getContent('WEB_title')"/></h2>
+  <metal:block metal:define-slot="navsel"/>
+  <div class="mainnav">
+    <span tal:attributes="class python:here.getPathStyle('basic', menusel, 'mainmenu')"><a href="editBasic">Basic information</a></span>
+    <span tal:attributes="class python:here.getPathStyle('description', menusel, 'mainmenu')"><a href="edit">Project description</a></span>
+    <span tal:attributes="class python:here.getPathStyle('images', menusel, 'mainmenu')"><a href="manageImages">Images</a></span>
+    <span tal:attributes="class python:here.getPathStyle('publications', menusel, 'mainmenu')"><a href="managePublications">Publications</a></span>
+    <span tal:attributes="class python:here.getPathStyle('relatedProjects', menusel, 'mainmenu')"><a href="manageRelatedProjects">Related Projects</a></span>
+    <span tal:attributes="class python:here.getPathStyle('themes', menusel, 'mainmenu')"><a href="tagTheProject">Tags</a></span>
+    <span class="mainmenu"><a target="_blank" href="index_html">View</a></span>
+  </div>
+  <div class="content">
+  <tal:block metal:define-slot="body"/>
+  </div>
+</body>
+</html>
\ No newline at end of file