# HG changeset patch # User casties # Date 1369144292 -7200 # Node ID 7b96a85552aaf934e87c9feb8e723cbb8da935ec # Parent 2dd8e3be4a8e14042c853fc4934af3b2f801fafa fix bugs in project editing. only show images with captions in project description. diff -r 2dd8e3be4a8e -r 7b96a85552aa HashTree.py --- a/HashTree.py Thu May 16 15:58:28 2013 +0200 +++ b/HashTree.py Tue May 21 15:51:32 2013 +0200 @@ -158,13 +158,13 @@ def getChildrenOf(self, key): """Return the list of child (values) of the node under key.""" node = self.getNode(key) - if node.children is None: + if getattr(node, 'children', None) is None: return [] else: # sort children by key childlist = sorted(node.children.items(), key=lambda x:x[0]) # and return the values - return [n.value for (k, n) in childlist if n.value is not None] + return [n.value for k, n in childlist if n.value is not None] def getAncestorsOf(self, key): diff -r 2dd8e3be4a8e -r 7b96a85552aa MPIWGProjects.py --- a/MPIWGProjects.py Thu May 16 15:58:28 2013 +0200 +++ b/MPIWGProjects.py Tue May 21 15:51:32 2013 +0200 @@ -371,12 +371,6 @@ # {'label':'Edit Themes & Disciplines','action':'editMPIWGDisciplinesThemesForm'}, # {'label':'Versionmanager','action':'versionManageForm'}, - # list of responsible scientists. entries are dicts with name, key, and username. - responsibleScientistsList = [] - - # thumbnail image - projectThumb = None - # # templates # @@ -421,6 +415,7 @@ 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 + self.projectThumb = None if argv: for arg in definedFields: @@ -512,7 +507,7 @@ def getResponsibleScientistsList(self): """returns a list with the responsible scientists as dicts with name, key, and shortname""" - return self.responsibleScientistsList + return getattr(self, 'responsibleScientistsList', []) def setResponsibleScientistsList(self, nameDict): @@ -574,7 +569,7 @@ def getThumbUrl(self, default=None): """returns the URL of the project thumbnail image""" - thumb = self.projectThumb + thumb = getattr(self, 'projectThumb', None) if thumb is None: # get thumb from list (thumb is last image) imgs = self.getImageList() @@ -1254,18 +1249,21 @@ return self.REQUEST['URL1'] + "/no_project" - def saveFromPreview(self): + def saveFromPreview(self, RESPONSE=None): """save content aus preview""" self.WEB_project_description = self.previewTemplate.WEB_project_description[0:] - self.REQUEST.RESPONSE.redirect("./index.html") + #self.REQUEST.RESPONSE.redirect("./index.html") + if RESPONSE is not None: + return self.editDescription() - def saveEditedContent(self, kupu=None, preview=None): + def saveEditedContent(self, kupu=None, preview=None, RESPONSE=None): """save Edited content""" # logging.debug("saveEditedContent kupu=%s preview=%s"%(kupu,preview)) if preview: kupu = preview + # find content of body tags start = kupu.find("
") end = kupu.find("") @@ -1277,10 +1275,11 @@ self.copyObjectToArchive() self.WEB_project_description = newcontent[0:] - self.REQUEST.RESPONSE.redirect("./index.html") + #self.REQUEST.RESPONSE.redirect("./index.html") - return True - + if RESPONSE is not None: + return self.editDescription() + def getBreadcrumbs(self): """return list of breadcrumbs from here to the root""" @@ -1322,7 +1321,7 @@ setattr(tmpPro, field, getattr(self, field)) tmpPro.WEB_project_description = description[0:] tmpPro.invisible = True - pt = PageTemplateFile('zpt/previewFrame.zpt', globals()).__of__(self) + pt = PageTemplateFile('zpt/project/edit_preview_frame', globals()).__of__(self) return pt() diff -r 2dd8e3be4a8e -r 7b96a85552aa css/mpiwg.css --- a/css/mpiwg.css Thu May 16 15:58:28 2013 +0200 +++ b/css/mpiwg.css Tue May 21 15:51:32 2013 +0200 @@ -89,6 +89,11 @@ margin: 0; } +h3 + h3 { + /* h3 directly after h3 has a margin */ + margin-top: 0.5em; +} + h1 a { /* a header with a link looks like a header */ color: inherit; diff -r 2dd8e3be4a8e -r 7b96a85552aa zpt/project/edit_description.zpt --- a/zpt/project/edit_description.zpt Thu May 16 15:58:28 2013 +0200 +++ b/zpt/project/edit_description.zpt Tue May 21 15:51:32 2013 +0200 @@ -15,7 +15,7 @@