From f62a907590af356b287c597b563b7fcdbe966dfe Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 12 Mar 2012 15:36:43 +0100 Subject: [PATCH 1/2] evaluate subtype relations also for normal concepts (e.g. queries) --- browser/form.py | 4 +++- browser/node.py | 4 ++-- browser/skin/lobo/body.pt | 12 +++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/browser/form.py b/browser/form.py index 481f30e..e7e6e2b 100644 --- a/browser/form.py +++ b/browser/form.py @@ -387,8 +387,10 @@ class CreateConceptForm(CreateObjectForm): include.remove('subtype') parentType = self.target.conceptType subtypePred = self.conceptManager['issubtype'] + tconcepts = (self.target.getChildren([subtypePred]) + + parentType.getChildren([subtypePred])) types = [dict(token=ConceptTypeInfo(t).token, title=t.title) - for t in parentType.getChildren([subtypePred])] + for t in tconcepts] if include or include is None: return util.KeywordVocabulary(types + self.listTypes(include, ('hidden',))) return util.KeywordVocabulary(types) diff --git a/browser/node.py b/browser/node.py index bbc975e..595e18f 100644 --- a/browser/node.py +++ b/browser/node.py @@ -117,8 +117,8 @@ class NodeView(BaseView): break data.insert(1, dict(label=p.title, url=absoluteURL(p, self.request))) - if self.virtualTarget: - data.extend(self.virtualTarget.breadcrumbs()) + if self.virtualTarget: + data.extend(self.virtualTarget.breadcrumbs()) return data def viewModes(self): diff --git a/browser/skin/lobo/body.pt b/browser/skin/lobo/body.pt index 38054fc..e9c1a36 100644 --- a/browser/skin/lobo/body.pt +++ b/browser/skin/lobo/body.pt @@ -33,11 +33,13 @@ You are here: - - - > + + + + > From 6bb4f350919bd4f7e759ea989c17d369b4b6fcd4 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 14 Mar 2012 16:42:53 +0100 Subject: [PATCH 2/2] new options for resources: suppress external editing, do not normalize filename on download --- browser/common.py | 2 ++ browser/resource.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/common.py b/browser/common.py index 1e400cb..e96c7ac 100644 --- a/browser/common.py +++ b/browser/common.py @@ -671,6 +671,8 @@ class BaseView(GenericView, I18NView): @Lazy def xeditable(self): + if self.typeOptions('no_external_edit'): + return False ct = getattr(self.context, 'contentType', '') if not ct or ct in ('application/pdf', 'application/x-pdf'): return False diff --git a/browser/resource.py b/browser/resource.py index 7d41259..e2a9816 100644 --- a/browser/resource.py +++ b/browser/resource.py @@ -207,7 +207,8 @@ class ResourceView(BaseView): data = context.data if useAttachment: filename = adapted(self.context).localFilename or getName(self.context) - filename = NameChooser(getParent(self.context)).normalizeName(filename) + if not self.typeOptions('no_normalize_download_filename'): + filename = NameChooser(getParent(self.context)).normalizeName(filename) response.setHeader('Content-Disposition', 'attachment; filename=%s' % filename) response.setHeader('Content-Length', len(data))