add some flexibility to resources listing and Lobo Layout

This commit is contained in:
Helmut Merz 2012-03-11 16:17:45 +01:00
parent a415e83468
commit 364a0c8c58
2 changed files with 5 additions and 3 deletions

View file

@ -182,7 +182,7 @@
<metal:resources define-macro="conceptresources">
<div tal:attributes="class string:content-$level;
ondblclick python: item.openEditWindow('resources.html')"
tal:define="resources python: list(item.resources())"
tal:define="resources resources|python:list(item.resources())"
tal:condition="resources">
<h2 i18n:translate="">Resources</h2>
<form method="post"

View file

@ -153,13 +153,15 @@ class Layout(Base, ConceptView):
macroName = 'layout'
def getParts(self):
result = []
parts = (self.params.get('parts') or [''])[0].split(',') # obsolete
if not parts or not parts[0]:
parts = (self.options('parts') or
self.typeOptions('parts') or
['h1', 'g3'])
#ti = adapted(self.context.conceptType).typeInterface
return self.getPartViews(parts)
def getPartViews(self, parts):
result = []
for p in parts:
viewName = 'lobo_' + p
view = component.queryMultiAdapter((self.context, self.request),